Show help on /, document better
This commit is contained in:
parent
0cc34b3025
commit
b70694ffa2
24
README.md
24
README.md
|
@ -24,6 +24,30 @@ This represents Season 1, Episode 1 of My Little Pony: Friendship Is Magic. The
|
||||||
shown on The Hub (now Discovery Family Network). If `is_movie` is set and the
|
shown on The Hub (now Discovery Family Network). If `is_movie` is set and the
|
||||||
season number is `99`, the episode record should be treated as a movie.
|
season number is `99`, the episode record should be treated as a movie.
|
||||||
|
|
||||||
|
Clients
|
||||||
|
-------
|
||||||
|
|
||||||
|
None yet
|
||||||
|
|
||||||
|
Routes
|
||||||
|
------
|
||||||
|
|
||||||
|
The canonical route base for PonyAPI is http://ponyapi.apps.xeserv.us. Example
|
||||||
|
usage:
|
||||||
|
|
||||||
|
```console
|
||||||
|
curl http://ponyapi.apps.xeserv.us/season/1/episode/1
|
||||||
|
{
|
||||||
|
"episode": {
|
||||||
|
"air_date": 1286735400,
|
||||||
|
"episode": 1,
|
||||||
|
"is_movie": false,
|
||||||
|
"name": "Friendship is Magic Part 1",
|
||||||
|
"season": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### `/all`
|
### `/all`
|
||||||
|
|
||||||
Returns all information about all episodes. This returns an array of Episode
|
Returns all information about all episodes. This returns an array of Episode
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import os
|
import os
|
||||||
import random
|
import random
|
||||||
from flask import Flask, abort, jsonify, request
|
from flask import Flask, abort, jsonify, request, redirect
|
||||||
|
|
||||||
# An Episode is constructed as such:
|
# An Episode is constructed as such:
|
||||||
# data Episode = Episode
|
# data Episode = Episode
|
||||||
|
@ -34,7 +34,7 @@ app = Flask(__name__)
|
||||||
|
|
||||||
@app.route("/")
|
@app.route("/")
|
||||||
def hello():
|
def hello():
|
||||||
return "Welcome to the Pony API!"
|
return redirect("https://github.com/Xe/PonyAPI#ponyapi", code=302)
|
||||||
|
|
||||||
@app.route("/all")
|
@app.route("/all")
|
||||||
def all_episodes():
|
def all_episodes():
|
||||||
|
|
Loading…
Reference in New Issue