diff --git a/main_controller.py b/main_controller.py index c88631f..ccbc8f6 100644 --- a/main_controller.py +++ b/main_controller.py @@ -7,12 +7,13 @@ import database as db app = Flask("the-prestige", static_folder='simmadome/build') app.config['SECRET KEY'] = 'dev' -#app.config['SERVER_NAME'] = '0.0.0.0:5000' +#url = "sakimori.space:5000" +#app.config['SERVER_NAME'] = url socketio = SocketIO(app) # Serve React App -@app.route('/', defaults={'path': ''}) -@app.route('/') +@app.route('/', defaults={'path': ''}, subdomain = "simsim") +@app.route('/', subdomain = "simsim") def serve(path): if path != "" and os.path.exists(app.static_folder + '/' + path): return send_from_directory(app.static_folder, path) @@ -21,7 +22,7 @@ def serve(path): ### API -@app.route('/api/teams/search') +@app.route('/api/teams/search', subdomain = "simsim") def search_teams(): query = request.args.get('query') page_len = int(request.args.get('page_len')) @@ -41,7 +42,7 @@ def search_teams(): MAX_SUBLEAGUE_DIVISION_TOTAL = 22; MAX_TEAMS_PER_DIVISION = 12; -@app.route('/api/leagues', methods=['POST']) +@app.route('/api/leagues', methods=['POST'], subdomain = "simsim") def create_league(): config = json.loads(request.data) @@ -113,7 +114,7 @@ def create_league(): ### SOCKETS -thread2 = threading.Thread(target=socketio.run,args=(app,'0.0.0.0')) +thread2 = threading.Thread(target=socketio.run,args=(app,'sakimori.space:5000')) thread2.start() master_games_dic = {} #key timestamp : (game game, {} state)