Fundamental_Analysis/frontend/next.config.mjs
Lv, Qi 4881ac8603 feat: finalize backend readiness (config, limits, docs)
- Expose API Gateway port 4000 in docker-compose for local dev
- Enable dynamic API_GATEWAY_URL in Next.js config
- Add 64K context hard limit in report-generator to avoid LLM errors
- Add backend API readiness report
2025-11-22 00:57:23 +08:00

31 lines
841 B
JavaScript

import { fileURLToPath } from 'url';
import path from 'path';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
/** @type {import('next').NextConfig} */
const nextConfig = {
// Explicitly set Turbopack root to this frontend directory to silence multi-lockfile warning
turbopack: {
root: __dirname,
},
// Increase server timeout for long-running AI requests
experimental: {
proxyTimeout: 300000, // 300 seconds (5 minutes)
},
// Optimize for Docker deployment only in production
output: process.env.NODE_ENV === 'production' ? 'standalone' : undefined,
async rewrites() {
const apiUrl = process.env.API_GATEWAY_URL || 'http://api-gateway:4000';
return [
{
source: '/api/:path*',
destination: `${apiUrl}/v1/:path*`,
},
];
},
};
export default nextConfig;