Files
2026-05-03 09:21:16 +08:00

27 lines
563 B
TypeScript

import type { NextConfig } from "next"
const nextConfig: NextConfig = {
output: "standalone",
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*`,
},
{
source: "/healthz",
destination: `${backendUrl}/healthz`,
},
]
},
}
export default nextConfig