sails
Version:
API-driven framework for building realtime apps, using MVC conventions (based on Express and Socket.io)
14 lines (6 loc) • 774 B
Markdown
# api/controllers/
This is the directory that holds your controllers. In Sails, controllers are JavaScript files that contain logic for interacting with models and rendering appropriate views to the client.
When you call `sails generate api cats` via the command line from inside your project's root directory, Sails will generate the file `api/controllers/CatsController.js` along with a matching model.
The `api/controllers` directory can also contain _standalone actions_, which are JavaScript files containing a _single_ controller action, rather than a dictionary of actions.
See the [main actions and controllers documentation](https://sailsjs.com/documentation/concepts/actions-and-controllers) for more info.
<docmeta name="displayName" value="controllers">