# Router

Kind: global class

# new Router()

Basic router implementation for the ResourcefulApi.

Automagically creating api bound modules builds on an understanding of the available routes. To easily instantiate a Store bound to an endpoint, route information for that endpoint must be provided.

Since every endpoint is implemented differently and the choice where this route information comes from should be left to the endpoint developer, this library only assumes that route loading can be a asynchronous process which eventually returns and has a set of Route objects in this.routes, keyed by their module and methods. To ensure the latter, actually adding Routes should be done via addRoute.

# router.getRoutes() ⇒ Array.<Route>

Kind: instance method of Router

# router.addRoute(route)

Kind: instance method of Router

Param Type
route Route