king 1eabd7183c fix(routing): FastAPI(root_path=) 제거 — Mount/Route 비대칭 해결
Starlette Mount 가 FastAPI(root_path=...) 의 값을 mount 경로에 흡수해버려서
@app.get 라우트(/health/db)는 그대로지만 mount(/static)는 /orderlist/static
으로 등록되는 비대칭이 발생했다. NPM 이 /orderlist prefix 를 잘라서 백엔드로
보내면 /health/db 는 200 이지만 /static/css/style.css 는 404 가 났다.

해결: FastAPI 생성자에서 root_path 인자 제거. 대신 Dockerfile 의 uvicorn 명령에
--root-path "${APP_ROOT_PATH:-}" 를 추가해 ASGI scope 레벨에서만 root_path 가
세팅되도록 한다. 이러면 모든 라우트/마운트가 prefix 없이 등록되고 URL 생성
시에만 prefix 가 붙는다.

APP_ROOT_PATH 환경변수와 main.py 의 HTML 경로 치환 로직은 그대로 유지.
2026-05-24 14:05:32 +09:00
S
Description
No description provided
562 KiB
Languages
Python 44.2%
JavaScript 29.2%
CSS 14.4%
HTML 9.5%
Batchfile 1.3%
Other 1.4%