Devendra Verma Devendra Verma - 1 month ago 4x
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


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();}