- Added environment variables for backend URLs in the Dockerfile to facilitate dynamic configuration. - Updated Next.js configuration to include rewrites for health and API endpoints, improving backend connectivity. - Modified settings page to handle backend URL locking and normalization, enhancing user experience and data integrity.
19 lines
448 B
TypeScript
19 lines
448 B
TypeScript
import type { NextConfig } from "next";
|
|
|
|
const backendInternalUrl = (process.env.BACKEND_INTERNAL_URL ?? "http://127.0.0.1:8000").replace(
|
|
/\/$/,
|
|
"",
|
|
);
|
|
|
|
const nextConfig: NextConfig = {
|
|
output: "standalone",
|
|
async rewrites() {
|
|
return [
|
|
{ source: "/health", destination: `${backendInternalUrl}/health` },
|
|
{ source: "/api/:path*", destination: `${backendInternalUrl}/api/:path*` },
|
|
];
|
|
},
|
|
};
|
|
|
|
export default nextConfig;
|