ffc94f2846
Default backend URL changed from port 8080 (kubectl port-forward) to 18080 (docker compose Envoy Gateway). README updated to reflect the deploy/dev workflow.
22 lines
448 B
TypeScript
22 lines
448 B
TypeScript
import type { NextConfig } from "next"
|
|
|
|
const nextConfig: NextConfig = {
|
|
async rewrites() {
|
|
// 仅在开发环境启用 API 代理
|
|
if (process.env.NODE_ENV !== "development") {
|
|
return []
|
|
}
|
|
|
|
const backendUrl = process.env.NEXT_PUBLIC_BACKEND_URL || "http://localhost:18080"
|
|
|
|
return [
|
|
{
|
|
source: "/api/:path*",
|
|
destination: `${backendUrl}/api/:path*`,
|
|
},
|
|
]
|
|
},
|
|
}
|
|
|
|
export default nextConfig
|