import type { NextConfig } from "next"; const API_BASE = process.env.NEXT_PUBLIC_API_BASE ?? "http://localhost:31800"; const nextConfig: NextConfig = { // phase-15: Docker 프로덕션 이미지를 위한 standalone 출력(서버리스 번들). output: "standalone", // 다른 컴퓨터(같은 LAN)에서 http://<내IP>:31300 으로 접속 허용. // Next 16 은 dev 모드에서 localhost 외 origin 의 dev 자산 요청을 기본 차단하므로 // 사설망 대역을 명시한다. IP 가 바뀌면(예: 다른 와이파이) 여기에 추가하면 된다. allowedDevOrigins: ["192.168.0.*", "192.168.1.*", "10.0.0.*", "172.16.*"], // dev 프록시: 프론트의 상대 경로 /api/* 호출을 백엔드(:31800)로 전달. // lib/api.ts 는 절대 URL(API_BASE)을 쓰지만, 상대 경로 사용 시에도 동작하도록 둔다. async rewrites() { return [ { source: "/api/:path*", destination: `${API_BASE}/api/:path*`, }, ]; }, }; export default nextConfig;