diff --git a/frontend/lib/api/client.ts b/frontend/lib/api/client.ts index f0bc3321..e3d79d1a 100644 --- a/frontend/lib/api/client.ts +++ b/frontend/lib/api/client.ts @@ -2,19 +2,31 @@ import axios, { AxiosResponse, AxiosError } from "axios"; // API URL 동적 설정 - 환경별 명확한 분리 const getApiBaseUrl = (): string => { + console.log("🔍 API URL 결정 시작!"); + if (typeof window !== "undefined") { const currentHost = window.location.hostname; + const fullUrl = window.location.href; + + console.log("🌐 현재 접속 정보:", { + hostname: currentHost, + fullUrl: fullUrl, + port: window.location.port, + }); // 로컬 개발환경: localhost:9771 → localhost:8080 if (currentHost === "localhost" || currentHost === "127.0.0.1") { + console.log("🏠 로컬 환경 감지 → localhost:8080/api"); return "http://localhost:8080/api"; } // 서버 환경 (내부/외부 IP 모두): → 39.117.244.52:8080 + console.log("🌍 서버 환경 감지 → 39.117.244.52:8080/api"); return "http://39.117.244.52:8080/api"; } // 서버 사이드 렌더링 기본값 + console.log("🖥️ SSR 기본값 → 39.117.244.52:8080/api"); return "http://39.117.244.52:8080/api"; };