Commit b9c9291
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/
2001 parent aac8583 commit b9c9291
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
122 | 124 | | |
123 | 125 | | |
124 | 126 | | |
| |||
0 commit comments