Skip to content

Instantly share code, notes, and snippets.

@zoranf
Created April 3, 2013 12:01
Show Gist options
  • Save zoranf/5300611 to your computer and use it in GitHub Desktop.
Save zoranf/5300611 to your computer and use it in GitHub Desktop.
app.get('/lobby/:id', function(req, res) {
db.games.find( { name: req.params.id }, function(err, game) {
if (err) {
res.render('404', {
title: 'Game not found',
message: 'Game ' + req.params.id + 'not found'
});
console.log('error');
} else {
res.render('lobby', { title: 'Lobby', name: req.params.id });
console.log('hops');
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment