lib/connectController.js
function addCtrActionsToRouter(ctr, router, name, options) {
    for(let prop in ctr) {
        if(ctr[prop] instanceof Function) {
            const info = new RouteInfo(ctr, name, prop, ctr[prop], options)
            /**
             * e.g. router.get(path, Middleware).
             */
            const path = name ? '/' + name + info.path : info.path
            const mw = newMiddleware(info)
            debug('Add route to %s %s', info.method, path)
            router[info.method].call(router, path, mw)
        }
    }
    return router
}
function addCtrActionsToRouter(ctr, router, name, options) {
    for(let prop in ctr) {
        if(ctr[prop] instanceof Function) {
            const info = new RouteInfo(ctr, name, prop, ctr[prop], options)
            /**
             * e.g. router.get(path, Middleware).
             */
            const path = name ? '/' + name + info.path : info.path
            const mw = newMiddleware(info)
            debug('Add route to %s %s', info.method, path)
            router[info.method].call(router, path, mw)
        }
    }
    return router
}
function addCtrActionsToRouter ( ctr , router , name , options ) { for ( let prop in ctr ) { if ( ctr [ prop ] instanceof Function ) { const info = new RouteInfo ( ctr , name , prop , ctr [ prop ] , options ) /**
             * e.g. router.get(path, Middleware).
             */ const path = name ? '/' + name + info . path : info . path const mw = newMiddleware ( info ) debug ( 'Add route to %s %s' , info . method , path ) router [ info . method ] . call ( router , path , mw ) } } return router }
For each method of ctr object creates a new Middleware that
is added to router argument.
Route, query or body parameters are automatically mapped
to method arguments.
@param {Object} ctr Controller instance
@param {Router} router express.Router instance
@param {String} name controller name
@param {Object} options object with optional properties: name, redirectOnStringResult and resultHandler
@return {Router} express.Router instance
For each method of ctr object creates a new Middleware that is added to router argument . Route query or body parameters are automatically mapped to method arguments .