Advertisement
Guest User

middleware.js

a guest
May 1st, 2016
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. exports.initLocals = function(req, res, next) {
  2.    
  3.     var locals = res.locals;
  4.    
  5.     locals.navLinks = [
  6.         { label: 'Home',        key: 'home',        href: '/' },
  7.         { label: 'About Us',        key: 'about',       pages: [
  8.             { label: 'What We Do',      subkey: 'whatwedo', href: '/whatwedo'       },
  9.             { label: 'Our Journey',     subkey: 'journey',      href: '/journey'    },
  10.             { label: 'Meet the Committee',  subkey: 'committee',        href: '/committee'  },
  11.             { label: 'Meet the Trustees',   subkey: 'trustees',     href: '/trustees'   }
  12.                                          ] },
  13.         { label: 'Get Involved',    key: 'getinvolved', pages: [
  14.             { label: 'For Tutors',      subkey: 'getinvolvedtutors',    href: '/getinvolvedtutors'},
  15.             { label: 'For Schools',     subkey: 'getinvolvedschools',   href: '/getinvolvedschools'}
  16.                                          ] },
  17.         { label: 'Blog',        key: 'blog',        href: '/blog' },
  18.         { label: 'Contact Us',      key: 'contact',     href: '/contact'}
  19.     ];
  20.    
  21.     locals.user = req.user;
  22.    
  23.     next();
  24.    
  25. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement