2023-01-28 21:08:47 -08:00
|
|
|
|
|
|
|
|
|
|
|
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
|
2023-02-13 12:57:30 -08:00
|
|
|
print(base_domain)
|
2023-01-28 21:08:47 -08:00
|
|
|
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")
|
|
|
|
|
2023-02-13 12:57:30 -08:00
|
|
|
base_context_live = True
|
|
|
|
|
|
|
|
@app.route("/core/ping")
|
|
|
|
def aws_healthcheck_ping():
|
|
|
|
return flask.make_response("OK", content_type="text/plain")
|