here is my problem: I would like to create some subfolders inside /api/controllers in order to organize my source code. My problem there is that as soon as I create a new folder, blueprint api / routes / actions don't seem to work anymore.
From all my tests if I change /api/controller/UserController.js to /api/controller/newpath/UserController.js I can't get the beauty of blueprint working anymore.
Is there any way to do that?
Thanks Emmanuel
You can set this up. Its a bit undocumented, but you can setup a "_config" object on your controller
Check out this answer https://stackoverflow.com/a/22062367/1821723
Update January 2016
Since version 0.10.0, you can definitely do this.
The controller identity is its path, in your case
newPath/UserController
. So a custom routeconfig/routes.js
would be something like:Automatic actions still work. You can also create controllers like this with
sails generate controller newPath/user
.You're right. It doesn't work out of the box though you can try this approach:
In you
models/User.js
setidentity: "newpath/user"
Hope it helps!
You can config routes.js as below
Under api/controllers, you can manage sub folders and actions as:
Hope this is helpful for you!