feat: added flows endpoints to vite

This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-06-09 09:22:44 -03:00
commit 9e933c61c4

View file

@ -8,10 +8,12 @@ const apiRoutes = [
"^/chat/*",
"/version",
"/health",
"/flows",
"/flows/*",
];
// Use environment variable to determine the target.
const target = process.env.VITE_PROXY_TARGET || "http://127.0.0.1:7860/api/v1";
const target = process.env.VITE_PROXY_TARGET || "http://127.0.0.1:7860";
const proxyTargets = apiRoutes.reduce((proxyObj, route) => {
proxyObj[route] = {
@ -19,6 +21,7 @@ const proxyTargets = apiRoutes.reduce((proxyObj, route) => {
changeOrigin: true,
secure: false,
ws: true,
rewrite: (path) => `/api/v1${path}`,
};
return proxyObj;
}, {});