O'Reilly logo
  • Patrick S thinks this is interesting:

For example, you can perform authentication without rendering (this code is not in the ch8/app.js):

app.get('/locals',
  function(req, res){
    res.locals = { user: {admin: true}};
    next();
  }, function(req, res){
    res.render('index');
});

From

Cover of Pro Express.js

Note

response.locals() - pass data to templates