We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 997803b commit 9d2fd20Copy full SHA for 9d2fd20
src/components/ChatModule.tsx
@@ -39,8 +39,10 @@ interface ChatModuleProps {
39
40
/* ---- 환경변수: API End-Point -------------------------------------- */
41
// 별도의 API URL이 주어지지 않을 경우 localhost의 8000번 포트를 호출합니다.
42
-const API_BASE =
43
- import.meta.env.VITE_API_BASE_URL ?? "http://localhost:8000";
+// const API_BASE =
+// import.meta.env.VITE_API_BASE_URL ?? "http://localhost:8000";
44
+const FALLBACK_API = `${window.location.protocol}//${window.location.hostname}:8000`;
45
+const API_BASE = (import.meta.env.VITE_API_BASE_URL || FALLBACK_API).replace(/\/+$/, '');
46
47
/* ---- 유틸: 백엔드 호출 ------------------------------------------- */
48
type BackendResponse = { final_answer: string; cards: unknown[] };
0 commit comments