a Sails application.
This App exposes two models, through an CRUD API
(no authentication, no hassle). The existing models are called games and
misc. They have no predefined attributes and can be used as needed.
This assumes you have installed Sails, but if you don't; run:
npm install -g sails
-
In the project's directory, start the application:
sails lift -
You will be asked how to deal with migrations, for throwaway data, it shouldn't matter, just enter
1. -
The App should now be running locally on port 1337, head over to the App
This assumes you have installed Heroku's CLI, and that you are logged into your account.
-
In the project's directory, create an Heroku App:
heroku apps:create -
Deploy the project as the App:
git push heroku master -
Open the App for inspection:
heroku open -
That's it. Happy prototyping.
-
Data is cleared out on Heroku sleep for the App.
Assuming you are running locally, otherwise swap out http://localhost:1337
for whatever URL your deployed Heroku version is running on.
GET http://localhost:1137/misc
Using cUrl:
curl -X GET -H "Content-Type: application/json" "http://localhost:1337/misc/"
GET http://localhost:1137/misc/ID/
Using cUrl:
curl -X GET -H "Content-Type: application/json" "http://localhost:1337/misc/ID/"
POST http://localhost:1337/misc/create/?someAttribute=whatever
curl -X POST -H "Content-Type: application/json" -d '{ "someKey": "someValue" }' "http://localhost:1337/misc/create"
PATCH http://localhost:1337/misc/update/ID/?newAttr=someValue
Using cUrl:
curl -X PATCH -H "Content-Type: application/json" -d '{ "silly": "LoveSongs" }' "http://localhost:1337/misc/update/ID"
DELETE http://localhost:1337/misc/ID
Using cUrl:
curl -X DELETE "http://localhost:1337/misc/update/ID"
