index.js
function handleRequest(middleware, handlers, mode, checkArity, req, res, errorHandler) {
  const done = err => err && setImmediate(errorHandler, err, req, res);
  // run global middleware first, then start handling request
  // this is important to allow loggers for example to kick-in regardless
  runMiddlewareStack(middleware, req, res, (err) => {
    if (err) {
      done(err);
      return;
    }
    // try to apply supplied handlers to the requested operation
    handleOperation(handlers, mode, checkArity, req, res, done);
  });
}
function handleRequest(middleware, handlers, mode, checkArity, req, res, errorHandler) {
  const done = err => err && setImmediate(errorHandler, err, req, res);
  // run global middleware first, then start handling request
  // this is important to allow loggers for example to kick-in regardless
  runMiddlewareStack(middleware, req, res, (err) => {
    if (err) {
      done(err);
      return;
    }
    // try to apply supplied handlers to the requested operation
    handleOperation(handlers, mode, checkArity, req, res, done);
  });
}
function handleRequest ( middleware , handlers , mode , checkArity , req , res , errorHandler ) { const done = err => err && setImmediate ( errorHandler , err , req , res ) ; // run global middleware first, then start handling request // this is important to allow loggers for example to kick-in regardless runMiddlewareStack ( middleware , req , res , ( err ) => { if ( err ) { done ( err ) ; return ; } // try to apply supplied handlers to the requested operation handleOperation ( handlers , mode , checkArity , req , res , done ) ; } ) ; }
Execute middleware stack and handle request.
@private
Execute middleware stack and handle request .