Is it possible to disable blueprint in sails

放肆的年华 提交于 2019-12-22 05:03:05

问题


Is it possible to disable blueprint on certain controllers in sails?

I've created a controller and I would like to make it only accessible using the custom route I provided in the routes.js but when I do like controller/action I can still see the page.

In the controller I defined _config: {blueprints: {action: false, rest: false, shortcuts: false }}

Thanks


回答1:


It looks like there's an error in the docs. You no longer need the interior blueprints object for your per-route controller config. So in your controller, just do:

_config: { actions: false, rest: false, shortcuts: false }

and it should work fine. Sorry about that!

-- Edit --

The above is valid for v0.10.x only. For v0.9.x, you'll still need to define your per-controller config using _config.blueprints.



来源:https://stackoverflow.com/questions/22206264/is-it-possible-to-disable-blueprint-in-sails

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!