Files
gitlab-instance-0a899031_cn…/next.config.ts
root 283d65d1d1 ;s
2026-06-07 12:48:17 +08:00

39 lines
823 B
TypeScript

import type { NextConfig } from "next";
const fastApiTarget = (
process.env.FASTAPI_PROXY_TARGET ||
process.env.BACKEND_API_BASE_URL ||
process.env.API_PROXY_TARGET ||
"http://127.0.0.1:8000"
).replace(/\/$/, "");
const nextConfig: NextConfig = {
async rewrites() {
return {
beforeFiles: [
{
source: "/api/:path*",
destination: `${fastApiTarget}/api/:path*`,
},
],
};
},
allowedDevOrigins: [
"localhost",
"localhost:3000",
"127.0.0.1",
"127.0.0.1:3000",
"172.27.128.1",
"172.27.128.1:3000",
"192.168.41.222",
"192.168.41.222:3000",
"192.168.41.222:3001",
"http://localhost:3000",
"http://127.0.0.1:3000",
"http://172.27.128.1:3000",
"http://192.168.41.222:3000",
],
};
export default nextConfig;