Articles

CRUD in Sails.js and Node.js

Disable Blueprints First of all you need to disable all existing blueprints in config/blueprints.js . [crayon-5994b98361eef011241732/] Create Routes [crayon-5994b98361f13822161365/] Define Controller Action [crayon-5994b98361f33254374706/] Each model method will...

Create new Api in Sails.js

Create new Api [crayon-5994b983622bb098332730/] It will create a new Product model and ProductController file . Add Model Attributes [crayon-5994b983622c4190529229/]   Let me run the project now by using sails lift [crayon-5994b983622ca002547483/] Product...

Node.js: Connecting Sails.js App to MongoLab

Signup MongoLab First of all you need to create a new account at MongoLab. After created account you need to create a new deployment in Mongolab. Make sure you have selected free sandbox You also need to create a new database with this new sandbox. Create a new User...

Build Rest API with Node.js and Sails.js

Build Rest API with Node.js and Sails.js

What is Sails.jsĀ ? Sails is a Javascript framework designed to resemble the MVC architecture from frameworks like Ruby on Rails. It makes the process of building Node.js apps easier, especially APIs, single page apps and realtime features, like chat. What we will...

Better ways to write asynchronous code in node.js

Better ways to write asynchronous code in node.js

I am going to write asynchronous code in multiple ways. You can execute asynchronous code in callback way or promises way.I am going to implement one use case by using following patterns Callback way (callback hell) Async Library Promises Async/await USE CASE I have...