Node.js and Express.js Simplified
/
Router in Express.js
Router in Express.js
https://leanpub.com/node-and-express-simplified
Create a New Project Directory
https://leanpub.com/node-and-express-simplified
Create a
package.json
File
https://leanpub.com/node-and-express-simplified
Configure the Project as an ES Module Application
https://leanpub.com/node-and-express-simplified
Install Express
https://leanpub.com/node-and-express-simplified
Group Related Routes and Middleware
https://leanpub.com/node-and-express-simplified
Create a directory for the routers
https://leanpub.com/node-and-express-simplified
Create the route files
https://leanpub.com/node-and-express-simplified
Create a mini-app for the book-related routes and middleware
https://leanpub.com/node-and-express-simplified
Time to practice with routers
https://leanpub.com/node-and-express-simplified
Configure the Main Express Application
https://leanpub.com/node-and-express-simplified
Run Your Express.js Application
https://leanpub.com/node-and-express-simplified
Important Things to Know about Express Routers
https://leanpub.com/node-and-express-simplified
Routers do not inherit parent route parameters by default
https://leanpub.com/node-and-express-simplified
Routers can be mounted on other routers
https://leanpub.com/node-and-express-simplified
Previous
Route vs. Query Parameters in Express.js
Up next
Views in Express.js
In this chapter
Router in Express.js
Create a New Project Directory
Create a package.json File
Configure the Project as an ES Module Application
Install Express
Group Related Routes and Middleware
Configure the Main Express Application
Run Your Express.js Application
Important Things to Know about Express Routers