diff --git a/backend/__init__.py b/backend/__init__.py index 38bbc76..66b42d1 100644 --- a/backend/__init__.py +++ b/backend/__init__.py @@ -1,3 +1,4 @@ +import os import json import random from typing import List @@ -8,7 +9,7 @@ from bang.game import Game from bang.players import Player sio = socketio.Server(cors_allowed_origins="*") -app = socketio.WSGIApp(sio, static_files={ +static_files={ '/': {'content_type': 'text/html', 'filename': 'index.html'}, '/game': {'content_type': 'text/html', 'filename': 'index.html'}, '/robots.txt': {'content_type': 'text/html', 'filename': 'robots.txt'}, @@ -17,8 +18,11 @@ app = socketio.WSGIApp(sio, static_files={ '/manifest.json': {'filename': 'manifest.json'}, '/css': './css', '/js': './js', -}) +} +for file in [f for f in os.listdir('.') if '.js' in f or '.map' in f or '.html' in f]: + static_files[f'/{file}'] = f'./{file}' +app = socketio.WSGIApp(sio, static_files=static_files) games: List[Game] = [] online_players = 0 diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 43eac7f..df07892 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -7,7 +7,7 @@

{{$t("warning")}}

{{$t("connection_error")}}

-