Created
December 2, 2015 21:40
-
-
Save ObjectIsAdvantag/27ab7f7c6aefe07aed37 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install + check sails version, 0.11.3 actually | |
npm install -g sails | |
sails -v | |
# Create new app | |
sails new SailsDemo | |
# Launch, open a browser http://localhost:1337 | |
cd SailsDemo | |
sails lift | |
# Create a user CRUD | |
sails generate api user | |
sails lift # if asked for data migration, say either 2 or 3 | |
# Use Web browser or Postman collection to play with the CRUD | |
GET http://localhost:1337/user | |
GET http://localhost:1337/user/create | |
GET http://localhost:1337/user/update/1?name=Steve | |
POST http://localhost:1337/user | |
{ | |
"name": "Steve", | |
"city": "Carquefou" | |
} | |
http://localhost:1337/user/find | |
{ | |
"where" : { | |
"id" : { | |
">" : 3 | |
} | |
}, | |
"limit": 2, | |
"sort": "id DESC" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment