add API description
This commit is contained in:
parent
584b851b4c
commit
e7578e3fc3
34
README.md
34
README.md
@ -30,3 +30,37 @@ if you want to build a full docker image run:
|
|||||||
docker build .
|
docker build .
|
||||||
```
|
```
|
||||||
alternatively you can use `./docker/docker-compose.yml`
|
alternatively you can use `./docker/docker-compose.yml`
|
||||||
|
|
||||||
|
## API
|
||||||
|
|
||||||
|
the baseurl for the API is: `http://127.0.0.1/api/v1`
|
||||||
|
|
||||||
|
### subreddits
|
||||||
|
|
||||||
|
subreddit syntax `[baseurl]/r/[subreddit]/[type]`
|
||||||
|
|
||||||
|
[type] syntax
|
||||||
|
* `all` - returns the first 100 submissions of the subreddits page
|
||||||
|
* `random` - returns one random submission of the first 100
|
||||||
|
* `[0-99]` - returns a specific one
|
||||||
|
* if undefined returns random
|
||||||
|
|
||||||
|
the response looks like:
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"subs":[{
|
||||||
|
"score": Integer,
|
||||||
|
"nsfw": Boolean,
|
||||||
|
"author": String,
|
||||||
|
"text": String,
|
||||||
|
"time": Integer,
|
||||||
|
"title": String,
|
||||||
|
"downvotes": Integer,
|
||||||
|
"permalink": String,
|
||||||
|
"subreddit": String,
|
||||||
|
"url": String,
|
||||||
|
}],
|
||||||
|
"error": Boolean/String,
|
||||||
|
"type":String
|
||||||
|
}
|
||||||
|
```
|
Loading…
Reference in New Issue
Block a user