如何在Sailsjs中使用相同的URL模式调用不同的控制器操作

如何使用两个不同的控制器相同的url? 例如:

// config/routes.js module.exports.routes = { // The simple route you use to access to the search controller for now 'get /search': 'SearchController.index', // Route the calls to different controller 'get /:city/:locality': 'SearchController.index', 'get /:city/:product_name': 'ProductController.index' } 

我很确定这个问题的答案会适合你

在相同的路线上航行多个处理程序