# Router
Kind: global class
- Router
- new Router()
- .getRoutes() ⇒
Array.<Route>
- .addRoute(route)
# 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 Route
s 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 |