June 2013
Intermediate to advanced
236 pages
4h 33m
English
This chapter would be incomplete without revisiting the router middleware.
The router middleware is very special middleware. While other Express middlewares are inherited from Connect, router is implemented by Express itself. This middleware is solely responsible for empowering Express with Sinatra-like routes.
Connect-inherited middlewares are referred to in Express from the express object (express.favicon(), express.bodyParser(), and so on). The router middleware is referred to from the instance of the Express app (app.router).
To refresh your memory, we learned in Chapter 2, Your First Express App, that if the router middleware is not explicitly added in the middleware stack, it is added at the point where ...
Read now
Unlock full access