title: How to display message using connect-flash and express-messages on .dust file on Node
body: <p>I'm using <strong>Nodejs</strong> and <strong>Expressjs</strong> and <strong>Kraken</strong>, I need to display message when added a product on index but I tried many time for to config but messages still not appear as I expect. Here is my config.js:</p>
  
  <pre><code>var flash = require('connect-flash');
  app = module.exports = express();
  app.use(kraken(options));
  //flash
  app.use(flash());
  app.use(function (req, res, next) {
     res.locals.messages = require('express-messages')(req, res);
     next();
  });
  </code></pre>
  
  <p><strong>My controller :</strong> </p>
  
  <pre><code>router.post('/somePath', function (req, res) {
  //something to do to add
  res.flash('messages','Add success!!')
  res.render('path/index');
  });
  </code></pre>
  
  <p><strong>My index.dust file:</strong> </p>
  
  <pre><code>`{&gt;"layouts/master" /} 
   {&lt;body}
     {messages|s}
     // body goes here
   {/body}
  </code></pre>
  
  <p>`</p>