diff --git a/frontend/lib/api/client.ts b/frontend/lib/api/client.ts index e3d79d1a..41987d41 100644 --- a/frontend/lib/api/client.ts +++ b/frontend/lib/api/client.ts @@ -6,17 +6,18 @@ const getApiBaseUrl = (): string => { if (typeof window !== "undefined") { const currentHost = window.location.hostname; + const currentPort = window.location.port; const fullUrl = window.location.href; console.log("🌐 현재 접속 정보:", { hostname: currentHost, fullUrl: fullUrl, - port: window.location.port, + port: currentPort, }); // 로컬 개발환경: localhost:9771 → localhost:8080 - if (currentHost === "localhost" || currentHost === "127.0.0.1") { - console.log("🏠 로컬 환경 감지 → localhost:8080/api"); + if ((currentHost === "localhost" || currentHost === "127.0.0.1") && currentPort === "9771") { + console.log("🏠 로컬 개발 환경 감지 → localhost:8080/api"); return "http://localhost:8080/api"; }