Router
Static Method Summary
Static Public Methods | ||
public static |
map binds a set of resources to routes/controllers and returns |
Constructor Summary
Public Constructor | ||
public |
constructor(options: Object) |
Member Summary
Public Members | ||
public |
app: * |
|
public |
controllers: * |
|
public |
|
Method Summary
Public Methods | ||
public |
resource defines a resource and maps a set of routes to controllers |
Private Methods | ||
private |
_bindRoute(route: String, method: String, action: Function(req, res, next)) _bindRoute binds a route to a controller action |
|
private |
_bindRoutes(resourceName: String, actions: Object, options: Object) _bindRoutes binds a resource to a set of routes |
|
private |
_methodNotAllowedError(req: *, res: *, next: *): * |
Static Public Methods
public static map(options: Object, callback: Function(router)): * source
map binds a set of resources to routes/controllers and returns router instance
Params:
Name | Type | Attribute | Description |
options | Object | router config options |
|
options.app | Object | Restify app instance |
|
options.controllersPath | String | path to controllers directory |
|
options.restify | Object | optios to pass to built in restify app |
|
callback | Function(router) | router instance for extending resources |
Return:
* |
Public Constructors
Public Methods
public resource(name: String, options: Object) source
resource defines a resource and maps a set of routes to controllers
Private Methods
private _bindRoute(route: String, method: String, action: Function(req, res, next)) source
_bindRoute binds a route to a controller action
private _bindRoutes(resourceName: String, actions: Object, options: Object) source
_bindRoutes binds a resource to a set of routes
private _methodNotAllowedError(req: *, res: *, next: *): * source
Params:
Name | Type | Attribute | Description |
req | * | ||
res | * | ||
next | * |
Return:
* |