모든 localhost API 엔드포인트를 Gateway URL로 변경

- 모든 API 클라이언트에서 localhost 참조 제거
- Gateway URL 하드코딩: http://kt-event-marketing-api.20.214.196.128.nip.io
- 프로덕션/개발 환경 구분 제거
- 런타임 설정 로직 제거
- Dockerfile 및 배포 설정 추가
This commit is contained in:
cherry2250
2025-10-30 14:05:07 +09:00
parent e65ee14d61
commit f6f6e450cd
24 changed files with 1004 additions and 33 deletions
@@ -1,7 +1,6 @@
import axios, { AxiosInstance, AxiosError, InternalAxiosRequestConfig } from 'axios';
const ANALYTICS_HOST =
process.env.NEXT_PUBLIC_ANALYTICS_HOST || 'http://localhost:8086';
const ANALYTICS_HOST = 'http://kt-event-marketing-api.20.214.196.128.nip.io';
export const analyticsClient: AxiosInstance = axios.create({
baseURL: ANALYTICS_HOST,
+2 -12
View File
@@ -23,20 +23,10 @@ import type {
*
* 현재는 apiClient를 사용하되, baseURL을 오버라이드합니다.
*/
const EVENT_API_BASE = '/api/v1/events';
const EVENT_HOST = process.env.NEXT_PUBLIC_EVENT_HOST || 'http://localhost:8080';
/**
* Event Service용 API 클라이언트
* Event Service는 별도 포트(8080)에서 실행되므로 별도 클라이언트 생성
*
* 로컬 개발 환경: Next.js rewrites 프록시 사용 (CORS 회피)
* 프로덕션 환경: 환경 변수에서 직접 호스트 사용
*/
import axios from 'axios';
const isProduction = process.env.NODE_ENV === 'production';
const API_BASE_URL = isProduction ? EVENT_HOST : ''; // 개발 환경에서는 상대 경로 사용
const EVENT_API_BASE = '/api/v1/events';
const API_BASE_URL = 'http://kt-event-marketing-api.20.214.196.128.nip.io';
const eventApiClient = axios.create({
baseURL: API_BASE_URL,