From 353ccc2b4e430eda71bf117567c055a01fcea060 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Sun, 30 Aug 2026 12:54:36 +0900 Subject: [PATCH] =?UTF-8?q?chore(config):=20vite=20API=20=ED=94=84?= =?UTF-8?q?=EB=A1=9D=EC=8B=9C=20=ED=8F=AC=ED=8A=B8=EB=A5=BC=20AISLO=5FAPI?= =?UTF-8?q?=5FPORT=EB=A1=9C=20=EB=B0=94=EA=BF=80=20=EC=88=98=20=EC=9E=88?= =?UTF-8?q?=EA=B2=8C=20=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 병행 작업(CLAUDE.md 7장)에서 워크트리마다 자기 백엔드를 봐야 하는데 프록시 대상이 8000으로 하드코딩돼 있었다. 워크트리 vite(5174)를 `AISLO_API_PORT=8001`로 띄우면 그쪽 백엔드를 본다. 기본값이 8000이라 메인 폴더 동작은 그대로다. Co-Authored-By: Claude Opus 5 (1M context) --- vite.config.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index 768e3958..9f3b729f 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -2,6 +2,7 @@ import { resolve } from "node:path"; import { fileURLToPath } from "node:url"; const __dirname = fileURLToPath(new URL(".", import.meta.url)); +const apiTarget = `http://localhost:${process.env.AISLO_API_PORT ?? "8000"}`; /** * Vite 설정 — 임도 설계 웹앱 (Vanilla TS + Three.js) @@ -26,15 +27,17 @@ export default { server: { port: 5173, open: false, - // 백엔드(FastAPI) 프록시 — config_frontend.ts의 API_BASE_URL과 정합 + // 백엔드(FastAPI) 프록시 — config_frontend.ts의 API_BASE_URL과 정합. + // 포트는 AISLO_API_PORT로 바꿀 수 있다(기본 8000) — 워크트리를 나눠 쓰는 병행 + // 작업에서 각자 자기 백엔드를 보게 하려는 것이다(2026-08-30, CLAUDE.md 7장). proxy: { "/api": { - target: "http://localhost:8000", + target: apiTarget, changeOrigin: true, }, // B07 독립형 CAD 앱 — FastAPI 정적 마운트로 위임 "/b07-cad": { - target: "http://localhost:8000", + target: apiTarget, changeOrigin: true, }, },