You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
527 B
TypeScript

import type { NextConfig } from "next";
const API_BASE = process.env.NEXT_PUBLIC_API_BASE ?? "http://localhost:8000";
const nextConfig: NextConfig = {
// dev 프록시: 프론트의 상대 경로 /api/* 호출을 백엔드(:8000)로 전달.
// lib/api.ts 는 절대 URL(API_BASE)을 쓰지만, 상대 경로 사용 시에도 동작하도록 둔다.
async rewrites() {
return [
{
source: "/api/:path*",
destination: `${API_BASE}/api/:path*`,
},
];
},
};
export default nextConfig;