Skip to content

Commit b9c9291

Browse files
committed
fix(gensui): correct frontend dist path resolution
GENSUI_ROOT (gensui/config.py:14) resolves to /app/gensui — the Python package directory. app.py used GENSUI_ROOT / "frontend" / "dist" to locate the built admin UI, but the Docker image places the built frontend one level up, at /app/frontend/dist (see gensui/Dockerfile:31, `COPY --from=frontend-builder /app/frontend/dist ./frontend/dist` under WORKDIR /app). Effect: frontend_dist.exists() was always False inside the container, so the `/` route and the SPA catch-all were never registered. Every request to the root or any client-side route returned FastAPI's default 404: $ curl -s http://127.0.0.1:8787/ {"detail":"Not Found"} ...despite the built files being present and intact: $ docker exec gensui ls /app/frontend/dist/index.html /app/frontend/dist/index.html Fix: try GENSUI_ROOT.parent / "frontend" / "dist" first (matches the Docker layout), falling back to the original GENSUI_ROOT / "frontend" / "dist" if that doesn't exist — preserves behavior for the local `install.sh` install path, which may lay out files differently. After fix: $ curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:8787/ 200
1 parent aac8583 commit b9c9291

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

gensui/app.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ async def health_check():
118118
return {"status": "ok", "service": "gensui", "version": "0.1.0"}
119119

120120
# ── Serve Frontend (production) ──────────────────────────
121-
frontend_dist = GENSUI_ROOT / "frontend" / "dist"
121+
frontend_dist = GENSUI_ROOT.parent / "frontend" / "dist"
122+
if not frontend_dist.exists():
123+
frontend_dist = GENSUI_ROOT / "frontend" / "dist"
122124
if frontend_dist.exists():
123125
# Serve /assets/* static files
124126
assets_path = frontend_dist / "assets"

0 commit comments

Comments
 (0)