O'Reilly logo
  • Aem A thinks this is interesting:

To handle the population of the req.user object, you use the app.param() method that defines a middleware to be executed before any other middleware that uses that parameter. Here, the users.userById() method will be executed before any other middleware registered with the userId parameter, which in this case is the users.read() middleware.

From

Cover of MEAN Web Development

Note

app.param - you define a middleware to be exec before any other middleware