디버그 로그 추가

This commit is contained in:
hyeonsu 2025-09-04 15:46:17 +09:00
parent 0d629a27a6
commit 592b4d7222
1 changed files with 12 additions and 0 deletions

View File

@ -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";
};