bin/router.js
function Router(req, res, next) {
        const server = this;
        const state = {
            method: req.method.toUpperCase(),
            params: {},
            routes: routes.concat(),
            routeUnhandled: true,
            server: server,
        };
        run(state, req, res, err => {
            req.params = {};
            if (state.routeUnhandled) req.log('unhandled', 'Router had no matching paths');
            next(err);
        });
    }
function Router(req, res, next) {
        const server = this;
        const state = {
            method: req.method.toUpperCase(),
            params: {},
            routes: routes.concat(),
            routeUnhandled: true,
            server: server,
        };
        run(state, req, res, err => {
            req.params = {};
            if (state.routeUnhandled) req.log('unhandled', 'Router had no matching paths');
            next(err);
        });
    }
function Router ( req , res , next ) { const server = this ; const state = { method : req . method . toUpperCase ( ) , params : { } , routes : routes . concat ( ) , routeUnhandled : true , server : server , } ; run ( state , req , res , err => { req . params = { } ; if ( state . routeUnhandled ) req . log ( 'unhandled' , 'Router had no matching paths' ) ; next ( err ) ; } ) ; }
define the router middleware
define the router middleware