This start mixin supplies a server specific start function to get the application up and running on the node.js server backend.
Barefoot. | This start mixin supplies a server specific start function to get the application up and running on the node.js server backend. |
Private Functions | |
getServerOnlyFiles | Returns an array with absolute paths to the files contained in the server sub folder. |
prepareBrowserify | Adds the Browserify middleware the the given express.js app. |
Functions | |
start | On start on the server, this function creates an APIAdapter if apiRoutes are present in the startOptions. |
function start( Router, APIAdapter, startOptions )
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.
Before doing all this, startOptions is checked if an Express.JS app is present (if not, an error gets thrown which will stop the start process).
(Barefoot.Router) Router | A Barefoot.Router object. Important: This is is not an instance of the router, it is the “plain” object which can be used for running “new Router(...)”. |
(Object) startOptions | This object literal is passed to the router when initializing it. |
On start on the server, this function creates an APIAdapter if apiRoutes are present in the startOptions.
function start( Router, APIAdapter, startOptions )
Calls the passed starter function, buffered in preInitialize.
function start()