{ 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!

All posts in Promises & Callback

Raw Native Queries

1. Creating SailsJs Project Follow the below tutorial for setting up SailsJs Setting up sails project 2. Database Setup You can follow the below tutorial about setting up MySQL & MongoDb Setting up MySQL & MongoDB in SailsJs 3. Creating Models Use the below command to generate People model sails . . . Read more

Custom Promise

In sails we can write a custom promise, which can be used to convert any piece of code into promise Below is an example of writing custom promise function: getData() { return new Promise(function(resolve, reject){ Model.find().exec(function(err, result){ if(err) { reject(err); } resolve(result); }); }); }   In the above method, . . . Read more

Callback to Promises

As we all know Sails works on Non-Blocking I/O and due to which callbacks are used. Callback is invoked on completion of the function block and returns the control back to the calling function. Callbacks are good for developers who are getting started with SailsJs, as it is easy to . . . Read more