Trying to write some helper methods for an express 3.0 app. Here is an example to greet the user:
app.locals.greet = function(req,res) {
return "hey there " + req.user.name;
}
However, req and res aren’t available inside that function. How would I go about writing helpers that I can use inside my jade templates? Am I doing this wrong?
Have a look at my config
app.jsfile! that should work to you as the variables will e available at that context.