feat: added flows endpoints to vite
This commit is contained in:
parent
ab1f9ed371
commit
9e933c61c4
1 changed files with 4 additions and 1 deletions
|
|
@ -8,10 +8,12 @@ const apiRoutes = [
|
||||||
"^/chat/*",
|
"^/chat/*",
|
||||||
"/version",
|
"/version",
|
||||||
"/health",
|
"/health",
|
||||||
|
"/flows",
|
||||||
|
"/flows/*",
|
||||||
];
|
];
|
||||||
|
|
||||||
// Use environment variable to determine the target.
|
// 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) => {
|
const proxyTargets = apiRoutes.reduce((proxyObj, route) => {
|
||||||
proxyObj[route] = {
|
proxyObj[route] = {
|
||||||
|
|
@ -19,6 +21,7 @@ const proxyTargets = apiRoutes.reduce((proxyObj, route) => {
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
secure: false,
|
secure: false,
|
||||||
ws: true,
|
ws: true,
|
||||||
|
rewrite: (path) => `/api/v1${path}`,
|
||||||
};
|
};
|
||||||
return proxyObj;
|
return proxyObj;
|
||||||
}, {});
|
}, {});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue