base game code; there's no game here (yet)
This commit is contained in:
		
							
								
								
									
										29
									
								
								app/pylocal/core.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								app/pylocal/core.py
									
									
									
									
									
										Normal 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
 | 
			
		||||
		Reference in New Issue
	
	Block a user