[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).
@ -78,24 +76,24 @@ Here is an example response for `/posts` :
```json ```json
{ {
"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>",
"user": { "comments_count": 5,
"id": 1, "user": {
"firstname": "Raphael", "id": 3,
"lastname": "Cerveaux", "firstname": "Clementine Bauch",
"email": "raphael@crvx.fr", "lastname": "Clementine Bauch",
"comments_count": 3, "email": "Nathan@yesenia.net",
"pos": { "geo": {
"lat": "-37.3159", "lat": "-68.6102",
"lng": "81.1496" "lng": "-47.0653"
}
}
} }
] }
}
]
} }
``` ```