Migrating to Express v4.0.0

The biggest change that comes with Express Version 4.0 is that Connect is no longer a dependency. Additionally, most of Express's (and subsequently Connect's) bundled middleware has been stripped out and moved into individual repositories. This is to help speed up the development and release cycles for both the newly separated middleware modules as well as Express itself. The only middleware that remains is express.static (for convenience). The good news here is that we're no longer required to use Express's (and by proxy Connect's) middleware by default!

The other big change is the way routes work. In previous versions the router was a part of the middleware and the routes were all defined as app. verb (). Now, you ...

Get Web Development with MongoDB and Node.js now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.