You think that Sails.js is just simple Node.js? Well, think again..
Yeah..!! that’s true. Trust me, you don’t want to be that fool who considered Sail.js as a simple Node.js framework. As a matter of fact, Sails.js.js, simply can give you more. Why Sails.js..?? Is there anything so outstanding in it..?? Absolutely, you’re almost there. You can prefer sails js over any other node js frameworks. Let’s dig something up..!!
What is Sails.js ?
Sails.js, facilitates mobile application development by catering several commands to automate the creation of controllers as well as models.
It ideally uses Express for handling HTTP requests, and wraps socket.io for managing WebSockets. You have the option to use several various templating languages, however, it is EJS which is considered as the default, and hence it is always recommended to stick with EJS.
Keep these points in mind-
- Any database
- Powerful associations
- Auto-generate REST APIs
- Easy WebSocket Support
- Reusable security policies and Flexible asset pipeline
- Front-end agnostic and Rock-solid foundation
Why Sails.js ?
We think of node js, when you need not want to switch languages from working on server-side and client side. These are promising in the case of rapid web application development too. Next step is to select a better js framework. I would recommend you to go with Sails.js, i can justify my recommendations as well. Sails is a framework that addresses many issues that you had with Derby and Meteor, namely, both of these (Derby & Derby) frameworks seem very tightly coupled from the client to the server. Sails.js allows development to start ridiculously quick, you can easily create the application skeleton by running the “sails new myApp” command. Then, to create a Controller and Model for some data that you’re going to be working with, you run “sails generate foo“ (foo being the name of your model), you can configure the model much easier. Waterline is generally used by Sails as its ORM and it can provide the necessary thrust for rapid development. The adapter field points out the location of the stored data and you can also mix and match to have the option of storing some models in MySQL and others in Redis. This, to me stands out as one of the pivotal features which also promises a bright future Sails.Js.
On to Sails.js
sudo npm -g install sails
Creating a New Sails Project:
Create a new app:
sails new testApp
Now lift the server:
At this point, if you visit (http://localhost:1337/) you will see the default home page. So let’s enjoy sailing..!!