File size: 778 Bytes
4b81334
 
 
 
 
 
 
 
 
8ac2dd1
4b81334
 
6be14c8
 
4b81334
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/** @type {import('next').NextConfig} */
// All /api/* requests from the browser are transparently proxied to the
// FastAPI process on 127.0.0.1:8000. Only port 7860 is exposed by the HF Space.
const nextConfig = {
  reactStrictMode: true,
  output: "standalone" === process.env.NEXT_OUTPUT ? "standalone" : undefined,
  // Allow large PDF uploads through the upload route handler
  experimental: {
    serverActions: { bodySizeLimit: "100mb" },
    proxyClientMaxBodySize: "100mb",
  },
  async rewrites() {
    const backend =
      process.env.BACKEND_INTERNAL_URL || `http://127.0.0.1:${process.env.BACKEND_PORT || "8000"}`;
    return [
      {
        source: "/api/:path*",
        destination: `${backend}/:path*`,
      },
    ];
  },
};

module.exports = nextConfig;