I've been using Restify for some time now. I ran across some code that lacks next()
and it occurred to me that I'm not sure if I fully understand the reason why next()
should be called after res.send()
. I get why would use it in a middleware situation, but for a normal route why is it needed? For example:
server.get('/a/:something/',function(req,res,next) {
res.send('ok');
});
vs
server.get('/b/:something/',function(req,res,next) {
res.send('ok');
return next();
});
If return next();
is left out of the code it seems to not cause errors and works from what that I can see.