nl_tokens: Function : start On start on the server this function creates an <APIAdapter > if apiRoutes are present in the startOptions . Further the actual <Barefoot . Router > is created an started using <Barefoot . Router . Server . start > .
pl_tokens: function start ( Router , APIAdapter , startOptions ) { debug ( 'Starting server' ) ; if ( ! _ . has ( startOptions , 'app' ) ) { throw new Error ( 'Missing "app" property in "startOptions"! Please ' + 'pass a valid express app instance when starting the barefoot ' + 'router on the server.' ) ; } if ( ! _ . has ( startOptions , 'mainJavaScriptFile' ) ) { throw new Error ( 'Missing "mainJavaScriptFile" property in ' + '"startOptions"! Please describe how browserify should serve your' + ' applications code.' ) ; } var app = startOptions . app , apiAdapter ; if ( _ . has ( startOptions , 'setupMiddlewares' ) ) { startOptions . setupMiddlewares ( app ) ; } if ( _ . has ( startOptions , 'setupApiAdapter' ) ) { apiAdapter = new APIAdapter ( startOptions ) ; startOptions . setupApiAdapter ( apiAdapter ) ; if ( ! _ . isUndefined ( apiAdapter , 'sync' ) ) { Backbone . sync = function ( ) { return apiAdapter . <mask> . apply ( apiAdapter , arguments ) ; } ; } startOptions . apiAdapter = apiAdapter ; } prepareBrowserify ( app , startOptions . mainJavaScriptFile ) ; // Just inject everything from the startup options into the router. var concreteServerRouter = new Router ( startOptions ) ; concreteServerRouter . start ( ) ; }