Chapter 5. Routing

This chapter covers

  • Simple and pattern-matching routing
  • Using middleware with routing
  • Serving static files with express.static, Express’s built-in static file middleware
  • Using Express with Node’s built-in HTTPS module

As you’ve seen, routing is one of Express’s big features, allowing you to map different requests to different request handlers. In this chapter, we’ll go far more in depth. We’ll look at routing in detail, show how to use Express with HTTPS, explore Express 4’s new routers features, and more. We’ll also build a couple of routing-centric applications, one of which will be a running example throughout the remainder of the book.

In this chapter, I’ll tell you everything there is to know about routing in Express. ...

Get Express in Action 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.