const flashMsg = (req, res, next) => { if (req.session.flashData) { for (const key in req.session.flashData) { res.locals[key] = req.session.flashData[key] } req.session.flashData = null } next() } module.exports = flashMsg
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter