[Docs] README

develop
sundowndev 2018-09-03 15:32:40 +02:00
parent 961f2335de
commit 1a463c718b
1 changed files with 18 additions and 20 deletions

View File

@ -33,7 +33,7 @@ $ docker-compose up -d
### API endpoints ### API endpoints
| Method / Route | Resource | Description | | Method / Route | Resource(s) | Description |
| --------------------- | ------------------ | ------------ | | --------------------- | ------------------ | ------------ |
| `GET` /posts | Posts,Users | Fetch posts and their users | | `GET` /posts | Posts,Users | Fetch posts and their users |
@ -44,8 +44,6 @@ The `/posts` route can receive extra parameters :
| user_pos | eq,cancer,cap,arctic,antarctic | Search posts by user position | | user_pos | eq,cancer,cap,arctic,antarctic | Search posts by user position |
| user | *int* | Search posts of a single user using user id | | user | *int* | Search posts of a single user using user id |
A bad value will result in an error.
### Response ### Response
The response follows the [Google JSON guide](https://google.github.io/styleguide/jsoncstyleguide.xml). The response follows the [Google JSON guide](https://google.github.io/styleguide/jsoncstyleguide.xml).
@ -80,18 +78,18 @@ Here is an example response for `/posts` :
{ {
"data": [ "data": [
{ {
"id": 1, "id": 21,
"title": "<h1>sunt aut facere repellat provident occaecati excepturi optio reprehenderit</h1>", "title": "<h1>asperiores ea ipsam voluptatibus modi minima quia sint</h1>",
"body": "<p>quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto</p>", "body": "<p>repellat aliquid praesentium dolorem quo\nsed totam minus non itaque\nnihil labore molestiae sunt dolor eveniet hic recusandae veniam\ntempora et tenetur expedita sunt</p>",
"comments_count": 5,
"user": { "user": {
"id": 1, "id": 3,
"firstname": "Raphael", "firstname": "Clementine Bauch",
"lastname": "Cerveaux", "lastname": "Clementine Bauch",
"email": "raphael@crvx.fr", "email": "Nathan@yesenia.net",
"comments_count": 3, "geo": {
"pos": { "lat": "-68.6102",
"lat": "-37.3159", "lng": "-47.0653"
"lng": "81.1496"
} }
} }
} }