Skip to content

Instantly share code, notes, and snippets.

@ObjectIsAdvantag
Created December 2, 2015 21:40
Show Gist options
  • Save ObjectIsAdvantag/27ab7f7c6aefe07aed37 to your computer and use it in GitHub Desktop.
Save ObjectIsAdvantag/27ab7f7c6aefe07aed37 to your computer and use it in GitHub Desktop.
# 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