Constructor
new ModelAPIRouter(model, optionsopt) → {ModelAPIRouter}
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
model |
mongoose.Model | String | model to be exposed | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options |
Object |
<optional> |
router configuration object
Properties
|
- Source:
Returns:
created router
- Type
- ModelAPIRouter
Methods
attachTo(app) → {ModelAPIRouter}
ModelAPIRouter.prototype.attachTo - attaches the router to the ModelAPIExpress
Parameters:
Name | Type | Description |
---|---|---|
app |
ModelAPIExpress | the API Application to which the router should be mounted |
- Source:
Returns:
self
- Type
- ModelAPIRouter
urls(rootPath) → {Array}
ModelAPIRouter.prototype.urls - returns avaliable urls
Parameters:
Name | Type | Description |
---|---|---|
rootPath |
String | the path to the router (before it) |
- Source:
Returns:
the list of avaliable urls
- Type
- Array