node.js - nodejs / express: does calling next() automatically return the function it is called from? -


just wanted out of head:

when dealing routing in express/ nodejs want know if calling next() returns function called from? consider:

app.get('/users/:id?', function(req, res, next){    //just as example    var err = dovalidation(req);    if (err) {        next(err);    }     next(); //will ever called? }); 

in case of error, second next() ever called, or call first next(err) (automagically) return function called from?

yes, if error, both called. want do:

if(err) {   return next(err);   } 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -