
Explore typescript async in node js with testing, building express and mongoose apps, setting up models and authentication, and learning callbacks, promises, async/await, and testing with marker and super test.
Install the latest Node.js, then install TypeScript globally (tsc), set up MongoDB, and install project dependencies like Express, Mongoose, and uuid to prepare the app.
Learn to install tsd and ambient type definitions for a TypeScript node app, create a typings folder, and resolve dependencies with npm to enable typings for libraries like mongoose.
Create a bin startup script in TypeScript, compile with the TypeScript compiler, and configure tsconfig with a basic test config to generate JavaScript with source maps.
Set up a simple Node.js Express server in TypeScript, configure a shared tsconfig, compile to JavaScript, define a get route, listen on localhost:2037, export the app, and test with Postman.
Learn to set up a basic Express app with a router and middleware in TypeScript, implement sign up and sign in routes, and handle authentication flow using request and response.
Set up Mongoose and body parsing middleware to parse JSON request bodies, create a sign-up route, and connect to a local MongoDB with a reusable connect function and event logging.
define a user model using TypeScript and mongoose, create a user schema with email and password, export the model, and implement a signup route that creates a user.
Learn to sign in by validating a user's email and password against the database, then create a session with a unique session id referencing the user for authentication.
Learn to build two Node.js middleware: a session-based auth checker that reads the authorization header and populates request.user, and an authenticated guard that blocks unauthenticated requests.
Implement a get current authenticated user route by querying the database with request user ID and returning the user, possibly hiding passwords, under an authenticated middleware with a session token.
Explore integration testing of a node api with Mocha and Supertest, set up test routes in TypeScript, connect to a test MongoDB via Mongoose, and clean the database between tests.
Set up npm scripts to run tests from a dedicated script, using should.js to assert response body types, values, and environment variables during automated Node.js testing.
Set up a signin route test in a Node app with Mongoose, using before hooks to connect, drop the database, create a user, and post credentials for a token.
Test signing in with a wrong password to ensure no token is returned, the response is not 200, and the message 'email or password incorrect' is shown.
Test the current user flow with supertest by creating a user, signing in to obtain a token, and using the authorization header to fetch /me in an integration test.
Learn how to replace callback hell with promises by creating an asynchronous function that resolves to a greeting for a name via a post route, or rejects with an error.
Explore how Mongoose integrates promises with callbacks, focusing on exec and query objects, and how to convert callback patterns to promise-based flows in TypeScript and Node.js with testing.
learn how TypeScript enables easier asynchronous programming with promises and async/await, using try/catch for error handling, and generators that compile to JavaScript.
Refactor signin flows from callbacks to async/await, using promises and try/catch for error handling, and test the signin flow and user lookup with simplified, promise-based functions.
Refactor the me route to async/await, implementing await-based user lookup and robust try/catch error handling. Improve tests with a single await to replace callback chains.
This course would teach you how to have a good mental model doing async programing in node.js leveraging typescript async await EcmaScript 7 (ES7) feauture.
you would also learn the build blocks of async/await which is Promise
Unit testing with mocha would be setup.
This course would teach you how to test rest api. with postman and later automate it with mocha unit test using supertest and an assetion library such as Should.js
Mongoose and mongodb would used and also setup interface for mongoose models in Typescript
getting acquinted with typescript
This course is structured in a way that it can get you up to speed with applying Typescript to Node.js.
you would also learn some Express.js basics and middlewares
you should take this course if you have started learning node.js or want to bring type safety to your Node.js app with Typescript or you want to learn how to use the beautiful async/await syntax to write more maintable code. this course also makes use of mongoose mongodb. so you would also learn how to use mongoose with typescript