当前位置: 动力学知识库 > 问答 > 编程问答 >

node.js - How to get rid of req.params.id in Sails.js

问题描述:

I created controller in 'api/controllers/UserController.js' and created an action there:

hello: function(req, res){

console.log('PARAMS:', req.params);

return res.send('hello');

}

When I hit in address line "http://localhost:1337/user/hello/erer" console.log() says:

PARAMS: [ id: 'erer' ]

But I need 404.

In config/blueprint.js I changed several lines:

rest: false,

shortcuts: false,

网友答案:

As the documentation explains, in order to disable the blueprints onto a single controller you have to override the blueprints configuration inside your controller by exporting an object _config

分享给朋友:
您可能感兴趣的文章:
随机阅读: