Skip to content

Instantly share code, notes, and snippets.

@zoranf
Created April 5, 2013 18:58
Show Gist options
  • Save zoranf/5321727 to your computer and use it in GitHub Desktop.
Save zoranf/5321727 to your computer and use it in GitHub Desktop.
// Index
app.get('/', function(req, res) {
if (!req.cookies.user) {
res.cookie('user', 'zoran.felbar@gmail.com');
// send that cookie is set to layout.jade
console.log('Cookie set');
} else {
console.log('Cookie already set');
// send that cookie is already set to layout.jade
}
db.games.find(function(err, docs) {
res.render('index', {
title: 'Home',
games: docs
});
console.log(docs);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment