Spaces:
Runtime error
Runtime error
Start app immediately and redirect root
Browse files
freeciv_env/server/app.py
CHANGED
|
@@ -5,6 +5,7 @@ import os
|
|
| 5 |
from urllib.request import Request, urlopen
|
| 6 |
|
| 7 |
from fastapi import Query
|
|
|
|
| 8 |
from openenv.core.env_server import create_app
|
| 9 |
|
| 10 |
from freeciv_env.adapter import prepare_observation
|
|
@@ -36,6 +37,11 @@ def create_freeciv_app(*, session_factory=create_live_session, max_turns: int |
|
|
| 36 |
app = create_freeciv_app()
|
| 37 |
|
| 38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
@app.get("/debug/internal-status")
|
| 40 |
def debug_internal_status() -> dict:
|
| 41 |
checks = []
|
|
|
|
| 5 |
from urllib.request import Request, urlopen
|
| 6 |
|
| 7 |
from fastapi import Query
|
| 8 |
+
from fastapi.responses import RedirectResponse
|
| 9 |
from openenv.core.env_server import create_app
|
| 10 |
|
| 11 |
from freeciv_env.adapter import prepare_observation
|
|
|
|
| 37 |
app = create_freeciv_app()
|
| 38 |
|
| 39 |
|
| 40 |
+
@app.get("/", include_in_schema=False)
|
| 41 |
+
def root() -> RedirectResponse:
|
| 42 |
+
return RedirectResponse(url="/web")
|
| 43 |
+
|
| 44 |
+
|
| 45 |
@app.get("/debug/internal-status")
|
| 46 |
def debug_internal_status() -> dict:
|
| 47 |
checks = []
|