Middleware

Map functions to a (set of) routes

http://expressjs.com/en/guide/using-middleware.html

  • Trigger side effects
  • Alter request
  • Alter response
  • "short circuit" request/response flow
Middleware Map functions to a (set of) routes http://expressjs.com/en/guide/using-middleware.html Trigger side effects Alter request Alter response "short circuit" request/response flow - logging for example - add stuff like "user id" - add headers for example - e.g. check auth & skip to error