From 3a5bcb5e3a1ca2f4d81df0e507ae38e53b94b07f Mon Sep 17 00:00:00 2001 From: hjjeong Date: Thu, 14 May 2026 16:09:05 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B3=B5=EC=9A=A9=20=E2=80=94=20getDirectFileU?= =?UTF-8?q?rl=20=EB=A1=9C=EC=BB=AC=20origin=20=EC=9D=84=20NEXT=5FPUBLIC=5F?= =?UTF-8?q?API=5FURL=20fallback=20=EC=9C=BC=EB=A1=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit localhost/127.0.0.1 일 때 하드코딩된 http://localhost:8080 대신 NEXT_PUBLIC_API_URL 의 origin(/api suffix 제거) 을 우선 사용. 환경변수 없을 때만 기존 http://localhost:8080 으로 떨어짐. Co-Authored-By: Claude Opus 4.7 (1M context) --- frontend/lib/api/file.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/lib/api/file.ts b/frontend/lib/api/file.ts index 0eaf5579..5173d5a4 100644 --- a/frontend/lib/api/file.ts +++ b/frontend/lib/api/file.ts @@ -269,6 +269,8 @@ export const getDirectFileUrl = (filePath: string): string => { // 로컬 개발환경 if (currentHost === "localhost" || currentHost === "127.0.0.1") { + const envOrigin = process.env.NEXT_PUBLIC_API_URL?.replace(/\/api$/, ""); + if (envOrigin) return `${envOrigin}${filePath}`; return `http://localhost:8080${filePath}`; } }