I am a beginner with Node.js and i absolutely love it. I wonder how can i handle flash message the best and easiest way.
I used connect-flash package in my site. Does it have better ones?
I always put my flash messages in my render function like this:
res.render('auth/login', {
title: 'Log in',
success: req.flash('success'),
error: req.flash('error')
});
Does it have a way to handle the gloabally? like in the res.locals.messages variable or something like this?
I use JADE html templating, so i print them like #{success}. How can i access a global variable this way to print my flash messages?
Thank you very much for your help and advices!