diff --git a/journey/troubleshooting/251128_ir_valuation_frontend_setup.md b/journey/troubleshooting/251128_ir_valuation_frontend_setup.md index 9d04653..6425be5 100644 --- a/journey/troubleshooting/251128_ir_valuation_frontend_setup.md +++ b/journey/troubleshooting/251128_ir_valuation_frontend_setup.md @@ -85,27 +85,36 @@ sudo systemctl reload nginx - `App.tsx`에 base path 처리 로직 추가 - `useLocation` hook으로 `/ir-valuation` base path를 제거하고 라우팅 -**파일**: `src/App.tsx:14-25` +**파일**: `src/App.tsx:14-30` ```typescript function Router() { const [location] = useLocation(); const basePath = "/ir-valuation"; - const normalizedLocation = location.startsWith(basePath) - ? location.slice(basePath.length) || "/" - : location; + + // Remove base path from location for routing + // Handle both /ir-valuation and /ir-valuation/ cases + let normalizedLocation = location; + if (location.startsWith(basePath + "/") || location === basePath) { + normalizedLocation = location.slice(basePath.length) || "/"; + // Remove trailing slash if present (except root) + if (normalizedLocation !== "/" && normalizedLocation.endsWith("/")) { + normalizedLocation = normalizedLocation.slice(0, -1); + } + } return ( -
404 Not Found
} /> +
404 Not Found - Location: {location}, Normalized: {normalizedLocation}
} />
); } ``` **검증**: -- `https://ro-being.com/ir-valuation/` 접근 시 IR 평가 페이지 정상 표시 +- `https://ro-being.com/ir-valuation/` 접근 시 IR 평가 페이지 정상 표시 확인 - 네트워크 요청 모두 200 OK 확인 +- ChatGPT 스타일 UI 정상 렌더링 (헤더, 업로드 버튼, 채팅 입력창) ## 다음 단계