This commit is contained in:
Weves
2023-12-05 18:17:53 -08:00
committed by Chris Weaver
parent 65fde8f1b3
commit 16c8969028
130 changed files with 5328 additions and 1888 deletions

View File

@ -24,20 +24,35 @@ const nextConfig = {
// In production, something else (nginx in the one box setup) should take
// care of this redirect. TODO (chris): better support setups where
// web_server and api_server are on different machines.
if (process.env.NODE_ENV === "production") return [];
return [
const defaultRedirects = [
{
source: "/api/stream-direct-qa:params*",
destination: "http://127.0.0.1:8080/stream-direct-qa:params*", // Proxy to Backend
permanent: true,
},
{
source: "/api/stream-query-validation:params*",
destination: "http://127.0.0.1:8080/stream-query-validation:params*", // Proxy to Backend
source: "/",
destination: "/search",
permanent: true,
},
];
if (process.env.NODE_ENV === "production") return defaultRedirects;
return defaultRedirects.concat([
{
source: "/api/chat/send-message:params*",
destination: "http://127.0.0.1:8080/chat/send-message:params*", // Proxy to Backend
permanent: true,
},
{
source: "/api/query/stream-answer-with-quote:params*",
destination:
"http://127.0.0.1:8080/query/stream-answer-with-quote:params*", // Proxy to Backend
permanent: true,
},
{
source: "/api/query/stream-query-validation:params*",
destination:
"http://127.0.0.1:8080/query/stream-query-validation:params*", // Proxy to Backend
permanent: true,
},
]);
},
publicRuntimeConfig: {
version,