SHARE
TWEET

Untitled

ArmyOfAnarchists Oct 31st, 2015 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // -/routes/index.js
  2. exports.index = function (req, res) {
  3.         session(req);
  4.         res.render('index', {
  5.                 title: 'Home',
  6.                 year: new Date().getFullYear(),
  7.                 session: {
  8.                         loggedIn: JSON.stringify(req.session.loggedIn),
  9.                         username: JSON.stringify(req.session.username),
  10.                         userID: JSON.stringify(req.session.userID)
  11.                 }
  12.         });
  13. };
  14.  
  15. // -/views/layout.jade
  16. - var session = !{JSON.stringify(session)};
  17.  
  18. doctype html
  19. html
  20.         head
  21.         meta(charset='utf-8')
  22.         (.....)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top