diff options
author | 2018-02-03 21:55:55 +0100 | |
---|---|---|
committer | 2018-02-03 21:55:55 +0100 | |
commit | 1b0dd9bcb244c5a5ea55108fb87cf12237044a98 (patch) | |
tree | 6d7064ad01c6554848090c4a4de5f84841a3ff3f /app.py | |
parent | fix readme (diff) |
adds a catchall for 404 and a healthcheck route
Diffstat (limited to 'app.py')
-rw-r--r-- | app.py | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -5,6 +5,7 @@ import os # Snekchek from flask import Flask +from flask import jsonify app = Flask(__name__) @@ -16,5 +17,15 @@ def _index(): return "Robots are taking over" [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) |