Tutorial by Examples

Prerequisites nodejs To install the latest stable release of sails with the command-line tool issue following command: $ sudo npm install sails -g Depending on your OS you might not need to use sudo.
Once you have Sails installed, just type $ sails new <project_name> This will create a skeleton Sails project in a new folder called <project_name>. You can also create a new project in an empty folder by typing $ sails new
Once your project has been created, you can launch the app by typing $ sails lift By default, you can access the app in the browser on port 1337. The URL with the port is shown in the terminal. Another way to start the Sails app is with the node command: $ node app.js However, you lose some...
This example shows how to develop our first application step by step, assuming you already have Sails installed and a project created. Create an empty controller file by typing $ sails generate controller hello Find the new controller file at api/controllers/HelloControllers.js and add th...
If there is no need for frontend in your next project, you can run sails new with additional flag --no-frontend. sails new NameOfProject --no-frontend This will generate everything needed for backend and will omit view, assets and grunt files. More about command line and sails-new: http://sails...

Page 1 of 1