簡體   English   中英

在Sails.js中當blueprint.rest = true時添加自定義操作

[英]Adding custom action when blueprint.rest=true in sailsjs

我只有blueprint.rest = true。 其他所有人都被禁用。 我喜歡rest = true,因為它適當地限制了GET / POST / PUT的查找/更新/銷毀/創建。

但是我想在控制器中添加另一個動作,就像

PUT / mycontroller /:id / validate

您可以在config/routes.js文件中添加此靜態路由。

“ PUT /您的控制器/:id / validate”:{

  controller : 'YourController', action: 'yourAction', } 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM