Node.js FAQ: Top Questions
35. What is Express Router in Node.js?
Express Router is a feature of Express.js that allows modular, mountable route handlers, enabling organized routing for large applications.
- Features: Define routes in separate modules, chainable handlers.
-
Mounting:
Attach routers to specific paths with
app.use
. - Benefits: Code organization, reusability.
- Use Case: API versioning, feature-specific routes.