title: req.flash is not a function error
body: <p>below is my code for registering a user. after intalling the necessary modules. express-flash-2 and express-session. The code below gave me the error "req.flash is not a function". any way I can go about it?</p>
  
  <pre><code>router.post('/register', function(req, res) {
    var db = firebase.database();
    var email = req.body.email;
    var name = req.body.name;
    var username = req.body.username;
    var password = req.body.password;
  
    if(email === "" || name === "" || username === "" || password === "") {
      req.flash('msg', 'All fields are required.'); 
      res.redirect('/signup');
    } else {
      console.log('register successfully');
    }
  </code></pre>
  
  <p>});</p>