Sails.js is a Node.js framework that allows you to build enterprise-ready, custom MVC ( model, view, controller ) application on-the-go. Sails.js has built-in features such as an API creator, and its socket integration in every route and database ORM makes it very useful and helps speed up development.
Sails.js has lots of features which will help you to build custom, enterprise-ready applications. Some of them are as follows:
- Auto generated API
- Database ORM
- Inbuilt task runner
- Security code
- Built-in web sockets in routes.
Unlike MEAN stack, where you need to create API's manually and do same repetitive thing again and again, Sails.js allows you to automatically create skeleton APIs. Just a single command, and you will have block of code generated to get you started. Additionally, Sails.js provides database drivers for every major database systems such as MySQL, MongoDB, PostgreSQL. Sails.js uses Grunt task runner as the default task runner, and also provides an effective way to manage custom grunt tasks. Furthermore, common security parameters such as CORS and CSRF are already included in Sails.js project. All you need to do is to enable them from respective files and your application is secured with the latest security standards. Sails.js uses Express to handle HTTP operations and Socket.io to handle web socket messages. It provides web socket messages to your routes without configuring it in back-end or front-end layer. We will learn about all of these features in a practical way in the coming section, where we'll generate an API and configure our database with models.
In order to install sails in your computer, make sure you have the latest version of Node and npm installed, because it needs various new things which is not present in legacy node versions.