23 lines
448 B
TypeScript
23 lines
448 B
TypeScript
import type { NextConfig } from "next";
|
|
|
|
const nextConfig: NextConfig = {
|
|
/* config options here */
|
|
output: "standalone",
|
|
async redirects() {
|
|
if (!process.env.BACKEND_PORT) {
|
|
throw new Error(
|
|
"Environment variable BACKEND_PORT is not defined.",
|
|
);
|
|
}
|
|
return [
|
|
{
|
|
source: "/api/:path",
|
|
destination: `http://localhost:${process.env.BACKEND_PORT}/:path`,
|
|
permanent: false,
|
|
},
|
|
];
|
|
},
|
|
};
|
|
|
|
export default nextConfig;
|