renamed /hosted/ to /room/

remove no longer used options
allow loading of json data files from webhost when it gets run by gunicorn and similar
This commit is contained in:
Fabian Dill 2021-07-24 14:08:45 +02:00
parent af30d8b7cd
commit 78f565c706
3 changed files with 5 additions and 3 deletions

View File

@ -210,8 +210,6 @@ def get_default_options() -> dict:
"spoiler": 2, "spoiler": 2,
"glitch_triforce_room": 1, "glitch_triforce_room": 1,
"race": 0, "race": 0,
"log_output_path": "Output Logs",
"log_level": None,
"plando_options": "bosses", "plando_options": "bosses",
} }
} }

View File

@ -6,6 +6,10 @@ import ModuleUpdate
ModuleUpdate.requirements_files.add(os.path.join("WebHostLib", "requirements.txt")) ModuleUpdate.requirements_files.add(os.path.join("WebHostLib", "requirements.txt"))
ModuleUpdate.update() ModuleUpdate.update()
# in case app gets imported by something like gunicorn
import Utils
Utils.local_path.cached_path = os.path.dirname(__file__)
from WebHostLib import app as raw_app from WebHostLib import app as raw_app
from waitress import serve from waitress import serve

View File

@ -169,7 +169,7 @@ def display_log(room: UUID):
return Response(_read_log(os.path.join("logs", str(room) + ".txt")), mimetype="text/plain;charset=UTF-8") return Response(_read_log(os.path.join("logs", str(room) + ".txt")), mimetype="text/plain;charset=UTF-8")
@app.route('/hosted/<suuid:room>', methods=['GET', 'POST']) @app.route('/room/<suuid:room>', methods=['GET', 'POST'])
def hostRoom(room: UUID): def hostRoom(room: UUID):
room = Room.get(id=room) room = Room.get(id=room)
if room is None: if room is None: