Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Express 3.0 flash messages with view helper

View app.js
1 2 3 4 5 6
app.use(require('connect-flash')());
// Expose the flash function to the view layer
app.use(function(req, res, next) {
res.locals.flash = function() { return req.flash() };
next();
})
tj commented

or res.locals.flash = req.flash.bind(req)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.