diff options
author | 2018-02-04 17:26:40 +0000 | |
---|---|---|
committer | 2018-02-04 17:26:40 +0000 | |
commit | a2f74c6122c760ab3f7915925acea6a60c6b9498 (patch) | |
tree | ba20bc7fc4c7013baab1f19f520d54e1d616527e /app.py | |
parent | Change names (diff) | |
parent | Merge pull request #2 from discord-python/route-404-and-healthcheck (diff) |
Merge branch 'master' of github.com:discord-python/webpage
Diffstat (limited to 'app.py')
-rw-r--r-- | app.py | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -4,7 +4,9 @@ import os # Snekchek -from flask import Flask, redirect +from flask import Flask +from flask import jsonify +from flask import redirect app = Flask(__name__) @@ -19,5 +21,15 @@ def index(): def invite(): return redirect("https://invite.pythondiscord.com/") [email protected]("/healthcheck") +def _healthcheck(): + return jsonify({"status":"ok"}) + + [email protected](404) +def _page_not_found(e): + return "replace me with a template, 404 not found", 404 + + if __name__ == '__main__': app.run(port=int(os.environ.get("WEBPAGE_PORT")), debug=False) |