UNPKG

sails

Version:

API-driven framework for building realtime apps, using MVC conventions (based on Express and Socket.io)

21 lines (12 loc) 2 kB
# api/ This folder contains the vast majority of your app's back-end logic. It is home to the 'M' and 'C' in <a href="http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller" target="_blank">MVC Framework</a>. In it you will find the following: - Controllers: [Actions](https://sailsjs.com/documentation/concepts/actions-and-controllers) contain back-end logic that handle incoming requests (like handling a form submission or responding with personalized, server-rendered HTML). - Helpers: [Helpers](https://sailsjs.com/documentation/concepts/helpers) are shared functions that can be called from anywhere in your app. - Models: [Models](https://sailsjs.com/documentation/concepts/models-and-orm) are the structures that contain data for your Sails App. - Policies: [Policies](https://sailsjs.com/documentation/concepts/policies) are middleware that restrict access to certain actions in your app. You may also find these folders, which are not always generated by default in new Sails apps: - Hooks: [Hooks](https://sailsjs.com/documentation/concepts/extending-sails/hooks) are modules that add functionality to Sails core. You can use hooks to run custom code when your app lifts and before handling every incoming request. Hooks can also be installed as plugins, but the hooks in this folder are always custom for your application. - Responses: [Custom responses](https://sailsjs.com/documentation/concepts/extending-sails/custom-responses) can help maintain consistent HTTP status codes and behavior across your app. (Since not every Sails application needs to define its own custom responses, this folder is sometimes excluded.) - Services: [Services](https://sailsjs.com/documentation/concepts/services) are shared utilities common in Sails apps written before version 1.0. They can be _just about anything_, so for new apps, it's recommended that you use [helpers](https://sailsjs.com/documentation/concepts/helpers) instead. <docmeta name="displayName" value="api">