Router

src/index.js

Instance members

#constructor(app)

Sets up the relevant gather/providers

constructor(app)

src/index.js

Sets up the relevant gather/providers

Parameters

  • app :
#getExpressApp

Returns the Express App instance.

getExpressApp

src/index.js

Returns the Express App instance.

Returns

Instance :

ExpressJs app instance.

#getRoutes

Returns the internal routing table.

getRoutes

src/index.js

Returns the internal routing table.

Returns

array :

routes which have been registered

#launch

Launches the Express app. Called by the app.load event.

launch

src/index.js

Launches the Express app. Called by the app.load event.

#setRoute(method, route, handler)

Adds a route to the internal routing table passed to Express. Accessed with the 'route' and 'middleware' gather.

setRoute(method, route, handler)

src/index.js

Adds a route to the internal routing table passed to Express. Accessed with the 'route' and 'middleware' gather.

Parameters

  • string method :

    Either 'get', 'post', 'put' or 'delete'.

  • string route :

    A URL route.

  • function handler :

    An ExpressJs type callback to handle the route.

#setStatic(prefix, path)

Adds a path to serve static files.

setStatic(prefix, path)

src/index.js

Adds a path to serve static files.

Parameters

  • string prefix :

    The path at which the static files will be accessible. For example: /js

  • string path :

    A fully resolved path.

#stop

Stops the express app. Called by the app.stop event.

stop

src/index.js

Stops the express app. Called by the app.stop event.