From 592b4d72224b71dce64561604195f0a127fc17e6 Mon Sep 17 00:00:00 2001 From: hyeonsu Date: Thu, 4 Sep 2025 15:46:17 +0900 Subject: [PATCH] =?UTF-8?q?=EB=94=94=EB=B2=84=EA=B7=B8=20=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/lib/api/client.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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"; };