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
- How to build a CRUD API with Sails.js in seconds
- How to add Bootstrap to our Sails.js projects
- How to Cross-Site Request Forgery Protection (CSRF) on Sails.js
We assume that you already have node.js installed
npm install sails
Then create a
sails new myapp
Go into our app folder
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:
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! ;)