aboutsummaryrefslogtreecommitdiffstats
path: root/app.py
diff options
context:
space:
mode:
authorGravatar JoeBanks13 <[email protected]>2018-02-04 17:26:40 +0000
committerGravatar JoeBanks13 <[email protected]>2018-02-04 17:26:40 +0000
commita2f74c6122c760ab3f7915925acea6a60c6b9498 (patch)
treeba20bc7fc4c7013baab1f19f520d54e1d616527e /app.py
parentChange names (diff)
parentMerge 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.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/app.py b/app.py
index fe3bed31..0ef2605f 100644
--- a/app.py
+++ b/app.py
@@ -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"})
+
+
+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)