Files
file-transfer-go/chuan-next/next.config.js
2025-08-01 19:38:59 +08:00

41 lines
840 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/** @type {import('next').NextConfig} */
const nextConfig = {
// 环境变量配置
env: {
GO_BACKEND_URL: process.env.GO_BACKEND_URL,
},
// 公共运行时配置
publicRuntimeConfig: {
apiBaseUrl: process.env.NEXT_PUBLIC_API_BASE_URL,
wsUrl: process.env.NEXT_PUBLIC_WS_URL,
},
// 服务器端运行时配置
serverRuntimeConfig: {
goBackendUrl: process.env.GO_BACKEND_URL,
},
// 重写规则 - 可选用于代理API请求
async rewrites() {
return [
{
source: '/api/proxy/:path*',
destination: `${process.env.GO_BACKEND_URL}/api/:path*`,
},
]
},
// 输出配置
output: 'standalone',
// 实验性功能
experimental: {
serverActions: {
allowedOrigins: ['localhost:3000', 'localhost:8080'],
},
},
}
module.exports = nextConfig