diff --git a/frontend/lib/api/client.ts b/frontend/lib/api/client.ts index 41987d41..ecd20973 100644 --- a/frontend/lib/api/client.ts +++ b/frontend/lib/api/client.ts @@ -21,7 +21,13 @@ const getApiBaseUrl = (): string => { return "http://localhost:8080/api"; } - // 서버 환경 (내부/외부 IP 모두): → 39.117.244.52:8080 + // 서버 환경에서 localhost:5555 → 39.117.244.52:8080 + if ((currentHost === "localhost" || currentHost === "127.0.0.1") && currentPort === "5555") { + console.log("🌍 서버 환경 (localhost:5555) 감지 → 39.117.244.52:8080/api"); + return "http://39.117.244.52:8080/api"; + } + + // 기타 서버 환경 (내부/외부 IP): → 39.117.244.52:8080 console.log("🌍 서버 환경 감지 → 39.117.244.52:8080/api"); return "http://39.117.244.52:8080/api"; }