code: function flash(options) {
      options = options || {};
      var safe = (options.unsafe === undefined) ? true : !options.unsafe;
  
    return function flashMiddlware(req, res, next) {
          if (!(res.flash && safe)) {
              res.flash = _flash;
          }
  
          /*
           * This is a hack for now.
           * Issue is we run socket.io from
           * server module.
           * We serve dashboard page from
           * dashboard module.
           *
           */
          if(!req.session) req.session = {};
  
          // put the flash into res.locals
          var flash = Keypath.get(res, 'req.session.flash', {});
          res.req.session.flash = {};
          res.locals.flash = flash;
          next();
      };
  }
docs: Expose `flash()` function on responses.
  
  @return {Function}
  @api public