Skip to content

Instantly share code, notes, and snippets.

@zerho
Last active December 19, 2015 19:39
Show Gist options
  • Save zerho/6007799 to your computer and use it in GitHub Desktop.
Save zerho/6007799 to your computer and use it in GitHub Desktop.
route
...
{
path: '/*',
httpMethod: 'GET',
middleware: [function(req, res) {
var role = userRoles.public, username = '';
if(req.user) {
role = req.user.role;
username = req.user.username;
}
res.cookie('user', JSON.stringify({
'username': username,
'role': role
}));
res.render('index');
}],
accessLevel: accessLevels.public
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment