How to build a CRUD API app with Sails.js 0.10 in seconds

I'm working and testing sails.js, so I'll be collecting all my experiences on a serie of posts.

Posts about Sails.js 0.10

We assume that you already have node.js installed

Just install sails :

npm install sails

Then create a sails application:

sails new myapp

Go into our app folder cd myapp

Create our controller and model:

sails generate api user

This will create two files: a model and a controller.

And the last step just start our little API CRUD example:

sails lift

Then we can test our app on http://localhost:1337 and create our first user as in the picture below.

Our if we wanna user a post request we can use a Chrome Extension like Postman and do a call to find user method:

Check sails documentation for more info, enjoy! ;)