Skip to content

Commit

Permalink
Update README with info for GET by id
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianfabian committed Oct 11, 2016
1 parent fc77bf7 commit 76c6822
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Continuous Integration is provided by [Travis-CI](http://travis-ci.org/).
####How do I run it?
After download the last [release](https://github.com/vesparny/silex-simple-rest/releases), from the root folder of the project, run the following commands to install the php dependencies, import some data, and run a local php server.

You need at least php **5.4.*** with **SQLite extension** enabled and **Composer**
You need at least php **5.5.9*** with **SQLite extension** enabled and **Composer**

composer install
sqlite3 app.db < resources/sql/schema.sql
Expand All @@ -35,6 +35,7 @@ From the root folder run the following command to run tests.
The api will respond to

GET -> http://localhost:9001/api/v1/notes
GET -> http://localhost:9001/api/v1/notes/{id}
POST -> http://localhost:9001/api/v1/notes
PUT -> http://localhost:9001/api/v1/notes/{id}
DELETE -> http://localhost:9001/api/v1/notes/{id}
Expand All @@ -44,8 +45,11 @@ Your api is CORS compliant out of the box, so it's capable of cross-domain commu

Try with curl:

#GET
#GET (collection)
curl http://localhost:9001/api/v1/notes -H 'Content-Type: application/json' -w "\n"

#GET (single item with id 1)
curl http://localhost:9001/api/v1/notes/1 -H 'Content-Type: application/json' -w "\n"

#POST (insert)
curl -X POST http://localhost:9001/api/v1/notes -d '{"note":"Hello World!"}' -H 'Content-Type: application/json' -w "\n"
Expand Down

0 comments on commit 76c6822

Please sign in to comment.