You can definitely do this. The trick is, the controller identity is its path, in your case admin/PageController
. So a custom route in config/routes.js
would be something like:
'GET /admin/page/foo': 'admin/PageController.foo'
The great thing is, automatic actions still work, so if you have an index
action in the controller then browsing to /admin/page
will automatically run it.
You can also create controllers like this with sails generate controller admin/page
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…