📅  最后修改于: 2022-03-11 15:04:21.743000             🧑  作者: Mango
/*
Some people always write return next() is to ensure that the execution stops after triggering the callback.
If you don't do it, you risk triggering the callback a second time later, which usually has devastating results.
*/
app.get('/users/:id?', function(req, res, next){
var id = req.params.id;
if(!id)
return next();
// do something
});