loopback-remote-routing
Easily disable remote methods.
Features
- selectively disable remote methods created by relations, defined by code or in definition
- selectively disable remote methods created by scopes , defined by code or in definition
- easily disable custom remote methods, currently works only when use RemoteRouting directly in js file
- support loopback-component-storage specific methods
- use as mixin
- support for loopback@3.x
Installation
npm install loopback-remote-routing --save
How to use
use directly
// common/models/color.jsvar RemoteRouting = ; module { // use only to expose specified remote methods // symbol @ denotes static method // scope methods are static method // custom remote method also need to follow the naming convention //use except to expose all remote methods except specified ones
use as a mixin
Add the mixins property to your server/model-config.json like the following:
To use with your Models add the mixins attribute to the definition object of your model config.
Options
option | type | description | required |
---|---|---|---|
only | [String] | expose specified remote methods | false |
except | [String] | expose all remote methods except specified ones | false |
You can only use options.only or options.except, do not use them together.
If you don't know the relation methods name , you can read the doc : http://loopback.io/doc/en/lb3/Exposing-models-over-REST.html
TODO
- allow disable custom remote methods
- disable alias remote methods, such as upert, patchOrCreate