All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 3m9s
Default 10mb caused upload-tagged 500s on scanned PDFs in case 1027-26 (Next 16 truncates body, FastAPI sees broken multipart, socket hang up). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
35 lines
792 B
TypeScript
35 lines
792 B
TypeScript
import type { NextConfig } from "next";
|
|
|
|
/**
|
|
* Proxies /api/* and /openapi.json to the FastAPI backend.
|
|
* In Docker both processes run in the same container, so the default
|
|
* target is http://127.0.0.1:8000. Override with NEXT_PUBLIC_API_ORIGIN
|
|
* if the backend lives elsewhere (e.g. during local dev).
|
|
*/
|
|
|
|
const API_ORIGIN =
|
|
process.env.NEXT_PUBLIC_API_ORIGIN ?? "http://127.0.0.1:8000";
|
|
|
|
const nextConfig: NextConfig = {
|
|
output: "standalone",
|
|
|
|
experimental: {
|
|
proxyClientMaxBodySize: "100mb",
|
|
},
|
|
|
|
async rewrites() {
|
|
return [
|
|
{
|
|
source: "/api/:path*",
|
|
destination: `${API_ORIGIN}/api/:path*`,
|
|
},
|
|
{
|
|
source: "/openapi.json",
|
|
destination: `${API_ORIGIN}/openapi.json`,
|
|
},
|
|
];
|
|
},
|
|
};
|
|
|
|
export default nextConfig;
|