cant set res.locals

I have the following instead of app.locals.use

app.use (req,res,done) ->
  res.locals.flash = '<li>uh oh!</li>';

In my Jade file, I do:


I keep receiving errors saying that flash isn’t defined..

Author: Fantashit

1 thought on “cant set res.locals

  1. make sure that you defined that middleware near the top (anywhere above app.router) so that it’s invoked before the routes, and make sure to call done()

Comments are closed.