是否可以禁用帆中的蓝图 [英] Is it possible to disable blueprint in sails

查看:56
本文介绍了是否可以禁用帆中的蓝图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以禁用风帆中某些控制器上的蓝图?

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

我已经创建了一个控制器,我想让它只能使用我在 routes.js 中提供的自定义路由访问,但是当我喜欢控制器/操作时,我仍然可以看到页面.

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.

在控制器中我定义了 _config: {blueprints: {action: false, rest: false,shortcuts: false }}

谢谢

推荐答案

文档中似乎有错误.您不再需要每个路由控制器配置的内部 blueprints 对象.因此,在您的控制器中,只需执行以下操作:

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!

-- 编辑 --

以上仅对 v0.10.x 有效.对于 v0.9.x,您仍然需要使用 _config.blueprints 定义每个控制器的配置.

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.

这篇关于是否可以禁用帆中的蓝图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆