From b70694ffa22232cc6a9014e9d109c1bf8bd99175 Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Sun, 9 Aug 2015 13:52:17 -0700 Subject: [PATCH] Show help on /, document better --- README.md | 24 ++++++++++++++++++++++++ ponyapi.py | 4 ++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3eebbed..8c65916 100644 --- a/README.md +++ b/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 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` Returns all information about all episodes. This returns an array of Episode diff --git a/ponyapi.py b/ponyapi.py index 589f7de..f4710f3 100644 --- a/ponyapi.py +++ b/ponyapi.py @@ -1,6 +1,6 @@ import os import random -from flask import Flask, abort, jsonify, request +from flask import Flask, abort, jsonify, request, redirect # An Episode is constructed as such: # data Episode = Episode @@ -34,7 +34,7 @@ app = Flask(__name__) @app.route("/") def hello(): - return "Welcome to the Pony API!" + return redirect("https://github.com/Xe/PonyAPI#ponyapi", code=302) @app.route("/all") def all_episodes():