Devendra Verma Devendra Verma - 1 year ago 135
Node.js Question

Disable blueprint routes sails js

Hello I have model users, in which there is a foreign key of Orders model.
Now sails will automatically generate route

. I have to disable this route. How to do this ? I have already tried to disable all routes of orders using:
_config : { actions: false, rest: false, shortcuts: false }
but it still doen't work

Answer Source

You can achieve this by adding custom routes, which will overwrite the blueprint action.


'/users/:id/orders': {response: 'forbidden'}


'/users/:id/orders': function(req, res) {res.forbidden();}
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download