lib/middleware/stack.js
function callResponseMiddleware(err, res1, res2) {
        i -= 1;
        if (i >= 0) {
            var next = self.middlewares[i].response;
            if (typeof next === 'function') {
                next(req, err, res1, res2, callResponseMiddleware);
            } else {
                // skip this middleware if it doesn't implement response
                callResponseMiddleware(err, res1, res2);
            }
        } else {
            callback(req, err, res1, res2);
        }
    }
function callResponseMiddleware(err, res1, res2) {
        i -= 1;
        if (i >= 0) {
            var next = self.middlewares[i].response;
            if (typeof next === 'function') {
                next(req, err, res1, res2, callResponseMiddleware);
            } else {
                // skip this middleware if it doesn't implement response
                callResponseMiddleware(err, res1, res2);
            }
        } else {
            callback(req, err, res1, res2);
        }
    }
function callResponseMiddleware ( err , res1 , res2 ) { i -= 1 ; if ( i >= 0 ) { var next = self . middlewares [ i ] . response ; if ( typeof next === 'function' ) { next ( req , err , res1 , res2 , callResponseMiddleware ) ; } else { // skip this middleware if it doesn't implement response callResponseMiddleware ( err , res1 , res2 ) ; } } else { callback ( req , err , res1 , res2 ) ; } }
This function call the next response middleware in the stack until there are none left; in that case the callback is called instead, and the middleware run is completed.
This function call the next response middleware in the stack until there are none left ; in that case the callback is called instead and the middleware run is completed .