aboutsummaryrefslogtreecommitdiffstats
path: root/app.py
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2018-02-05 12:22:49 +0000
committerGravatar Gareth Coles <[email protected]>2018-02-05 12:22:49 +0000
commitbeaa61362aed31f229c935a347e382024eee5a90 (patch)
tree4d9cf54e44b7fea4124389098fd0fa37a17cdad9 /app.py
parentAdd templates & static folder with .gitkeep's (diff)
Dynamic route loader; proper application structure
Also fixed flake8-imports getting the other wrong
Diffstat (limited to 'app.py')
-rw-r--r--app.py35
1 files changed, 5 insertions, 30 deletions
diff --git a/app.py b/app.py
index 7d1f3dcf..f3bb9a60 100644
--- a/app.py
+++ b/app.py
@@ -1,35 +1,10 @@
-#!/usr/bin/env python3
+# coding=utf-8
-import os
+from pysite.route_manager import RouteManager
-from flask import Flask
-from flask import jsonify
-from flask import redirect
-
-app = Flask(__name__)
-
-app.secret_key = os.environ.get("WEBPAGE_SECRET_KEY")
-
-
-def index():
- return "Coming soon:tm:"
-
-
-def invite():
- return redirect("http://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
+manager = RouteManager()
+app = manager.app
if __name__ == '__main__':
- app.run(port=int(os.environ.get("WEBPAGE_PORT")), debug=False)
+ manager.run()