Skip to content

Commit b12976f

Browse files
authored
always redirect back to index.html (#836)
1 parent 9afa7e9 commit b12976f

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

web/server/main.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,21 @@ def health() -> str:
4040
return "ok"
4141

4242

43-
@app.get("/")
44-
def index() -> HTMLResponse:
45-
with open(WEB_DIRECTORY / "client/dist/index.html", "r", encoding="utf-8") as f:
46-
return HTMLResponse(f.read())
47-
48-
4943
app.mount(
5044
"/assets",
5145
StaticFiles(directory=WEB_DIRECTORY / "client/dist/assets", check_dir=False),
5246
name="assets",
5347
)
48+
49+
5450
app.mount(
5551
"/favicons",
5652
StaticFiles(directory=WEB_DIRECTORY / "client/dist/favicons", check_dir=False),
5753
name="favicons",
5854
)
55+
56+
57+
@app.get("/{full_path:path}")
58+
async def index(full_path: str = "") -> HTMLResponse:
59+
with open(WEB_DIRECTORY / "client/dist/index.html", "r", encoding="utf-8") as f:
60+
return HTMLResponse(f.read())

0 commit comments

Comments
 (0)