aboutsummaryrefslogtreecommitdiff
path: root/uploader/base_routes.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-08-28 17:12:26 -0500
committerFrederick Muriuki Muriithi2024-08-28 17:54:17 -0500
commit06c6a7f7f42e8ff2d33a934ff695efde24d26d65 (patch)
tree0ab6115fa7a8ee490cc6efc343c44549c1871281 /uploader/base_routes.py
parent05191fa146fac31fd079c50bf6bcc4983f2f0792 (diff)
downloadgn-uploader-06c6a7f7f42e8ff2d33a934ff695efde24d26d65.tar.gz
Move code handling expression data upload into new module.
Diffstat (limited to 'uploader/base_routes.py')
-rw-r--r--uploader/base_routes.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/uploader/base_routes.py b/uploader/base_routes.py
index 9daf439..39db31f 100644
--- a/uploader/base_routes.py
+++ b/uploader/base_routes.py
@@ -1,9 +1,26 @@
"""Basic routes required for all pages"""
import os
-from flask import Blueprint, send_from_directory
+
+from flask import Blueprint, render_template, send_from_directory
+
+from uploader.oauth2.client import user_logged_in
base = Blueprint("base", __name__)
+
+@base.route("/favicon.ico", methods=["GET"])
+def favicon():
+ """Return the favicon."""
+ return send_from_directory(os.path.join(app.root_path, "static"),
+ "images/CITGLogo.png",
+ mimetype="image/png")
+
+
+@base.route("/", methods=["GET"])
+def index():
+ """Load the landing page"""
+ return render_template("index.html" if user_logged_in() else "login.html")
+
def appenv():
"""Get app's guix environment path."""
return os.environ.get("GN_UPLOADER_ENVIRONMENT")