This works for /path and /path/foo on express 4, note the * before ?.
router.get('/path/:id*?', function(req, res, next) {
res.render('page', { title: req.params.id });
});
This works for /path and /path/foo on express 4, note the * before ?.
router.get('/path/:id*?', function(req, res, next) {
res.render('page', { title: req.params.id });
});