{ sailsit }

Sails Js Tutorials for Beginners and Forum

Have a Question?

If you have any question you can ask below or enter what you are looking for!

Setting Up Sails Project

1. Creating Project

Create a new sails project using below command

sails new sails-first-project

 

2. Configuring Database

Configure your DB connections config/connections.js
Sails supports, MongoDB, MySQL, PostgreSQL

3. Configuring Models
  • Configure DB connection name in config/models.js
    Note: Use exact DB connection name as defined in config/connections.js
  • Change migrate method to safe

    migrate: "safe"
    

 

4. Generating Models/Controllers

You can use the below commands to generate Models or Controllers respectively

sails generate model ModelName

sails generate controller ControllerName

This completes your Sails Project Setup. Now you can get started with your further development.

(3) Comments

  1. Pingback: Sails – Autoreload – SailsIt

  2. Pingback: Sails – SMTP Email Trigger – SailsIt

  3. Pingback: Sails - Raw Native Queries - SailsIt

Comments are closed.