RESTful router.
(require("Router_Rest"))(app, baseRoute, options)
Create a RESTful router.
Parameters:
| Name | Type | Description |
|---|---|---|
app |
* | |
baseRoute |
string | |
options |
objects |
- Source:
- routers/rest.js
Properties:
| Name | Type | Argument | Description |
|---|---|---|---|
options.resourcesPath |
string |
<optional> |
|
options.middlewares |
object | array |
<optional> |
Example
'<base path>': {
rest: {
resourcesPath:
middlewares:
}
}
route http method function of ctrl
/:resource get query
/:resource post create
/:resource/:id get detail
/:resource/:id put update
/:resource/:id delete remove