Skip to content

Instantly share code, notes, and snippets.

@mariuskubilius
Forked from zoranf/app.js
Last active January 15, 2018 19:29
Show Gist options
  • Save mariuskubilius/5300639 to your computer and use it in GitHub Desktop.
Save mariuskubilius/5300639 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) {
console.log('error');
return res.render('404', {
title: 'Game not found',
message: 'Game ' + req.params.id + 'not found'
});
}
console.log('hops');
return res.render('lobby', { title: 'Lobby', name: req.params.id });
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment