O'Reilly logo

Node.js in Action by Mike Cantelon, Marc Harter, T.J. Holowaychuk and Nathan Rajlich

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Connect

In this chapter

  • Setting up a Connect application
  • How Connect middleware works
  • Why middleware ordering matters
  • Mounting middleware and servers
  • Creating configurable middleware
  • Using error-handling middleware

Connect is a framework that uses modular components called middleware to implement web application logic in a reusable manner. In Connect, a middleware component is a function that intercepts the request and response objects provided by the HTTP server, executes logic, and then either ends the response or passes it to the next middleware component. Connect “connects” the middleware together using what’s called the dispatcher.

Connect allows you to write your own middleware but also includes several common components ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required