2023-04-28 22:40:46 -07:00
|
|
|
/** @type {import('next').NextConfig} */
|
|
|
|
const nextConfig = {
|
2023-05-05 16:48:36 -07:00
|
|
|
output: "standalone",
|
2023-05-30 19:59:57 -07:00
|
|
|
rewrites: async () => {
|
|
|
|
// In production, something else (nginx in the one box setup) should take
|
|
|
|
// care of this rewrite. TODO (chris): better support setups where
|
|
|
|
// web_server and api_server are on different machines.
|
|
|
|
if (process.env.NODE_ENV === "production") return [];
|
|
|
|
|
|
|
|
return [
|
|
|
|
{
|
|
|
|
source: "/api/:path*",
|
|
|
|
destination: "http://127.0.0.1:8080/:path*", // Proxy to Backend
|
|
|
|
},
|
|
|
|
];
|
|
|
|
},
|
2023-05-05 16:48:36 -07:00
|
|
|
redirects: async () => {
|
2023-05-17 15:48:46 -07:00
|
|
|
// In production, something else (nginx in the one box setup) should take
|
2023-05-22 19:49:49 -07:00
|
|
|
// care of this redirect. TODO (chris): better support setups where
|
2023-05-22 14:01:20 -07:00
|
|
|
// web_server and api_server are on different machines.
|
|
|
|
if (process.env.NODE_ENV === "production") return [];
|
|
|
|
|
2023-05-17 15:48:46 -07:00
|
|
|
return [
|
|
|
|
{
|
2023-05-30 19:59:57 -07:00
|
|
|
source: "/api/stream-direct-qa:params*",
|
|
|
|
destination: "http://127.0.0.1:8080/stream-direct-qa:params*", // Proxy to Backend
|
2023-05-17 15:48:46 -07:00
|
|
|
permanent: true,
|
|
|
|
},
|
2023-09-01 20:32:22 -07:00
|
|
|
{
|
|
|
|
source: "/api/stream-query-validation:params*",
|
|
|
|
destination: "http://127.0.0.1:8080/stream-query-validation:params*", // Proxy to Backend
|
|
|
|
permanent: true,
|
|
|
|
},
|
2023-05-17 15:48:46 -07:00
|
|
|
];
|
2023-05-05 16:48:36 -07:00
|
|
|
},
|
2023-04-28 22:40:46 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = nextConfig;
|