Q36: What is Express Router and why is it used?
Express Router creates modular, mountable route handlers. Routers allow splitting route definitions into separate files for better code organization and maintainability.
Key Takeaways
- Enables modular structure for API route handlers.
- Acts as mini-middleware isolated to specific path prefixes.
Knowledge Check
How do you instantiate an Express router instance?