base game code; there's no game here (yet)

This commit is contained in:
2023-01-28 21:08:47 -08:00
parent 0cd9cc5fb7
commit 07b56dcd40
11 changed files with 232 additions and 0 deletions

29
app/pylocal/core.py Normal file
View File

@@ -0,0 +1,29 @@
import flask
app = flask.Flask("seagull-game", root_path="/app")
base_context = {}
base_context_live = False
def render_base_context():
global base_context
global base_context_live
print(flask.request.host)
domain_components = flask.request.host.split(".")
base_domain = ".".join(domain_components[-2:])
# all this wind up for...
if base_domain == "otl-hga.net": # production, use assets from S3
base_context["styles"] = ["https://cdn.otl-hga.net/seagull/css/seagull.css"]
base_context["scripts"] = ["https://cdn.otl-hga.net/seagull/js/seagull.js"]
base_context["seagull_pic"] = "https://cdn.otl-hga.net/seagull/image/seagull.jpg"
else: # dev, serve files from here
base_context["styles"] = [flask.url_for("static", filename="css/seagull.css")]
base_context["scripts"] = [flask.url_for("static", filename="js/seagull.js")]
base_context["seagull_pic"] = flask.url_for("static", filename="image/seagull.jpg")
base_context_live = True