Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // -/routes/index.js
- exports.index = function (req, res) {
- session(req);
- res.render('index', {
- title: 'Home',
- year: new Date().getFullYear(),
- session: {
- loggedIn: JSON.stringify(req.session.loggedIn),
- username: JSON.stringify(req.session.username),
- userID: JSON.stringify(req.session.userID)
- }
- });
- };
- // -/views/layout.jade
- - var session = !{JSON.stringify(session)};
- doctype html
- html
- head
- meta(charset='utf-8')
- (.....)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement