🔨 refactor(chatComponent): remove unused imports and variables, and extract postBuildInit function to API controller
✨ feat(API): add postBuildInit function to handle POST requests to /api/v1/build/init
The chatComponent file had unused imports and variables that were removed to improve code readability. The postBuildInit function was extracted to the API controller to improve code organization and maintainability. The function handles POST requests to /api/v1/build/init.
This commit is contained in:
parent
41f6aecda4
commit
52baae64e6
4 changed files with 40 additions and 30 deletions
|
|
@ -2,13 +2,12 @@ import { defineConfig } from "vite";
|
|||
import react from "@vitejs/plugin-react-swc";
|
||||
import svgr from "vite-plugin-svgr";
|
||||
const apiRoutes = [
|
||||
"/all",
|
||||
"/predict",
|
||||
"^/validate/*",
|
||||
"^/chat/*",
|
||||
"/version",
|
||||
"/api/v1/all",
|
||||
"/api/v1/predict",
|
||||
"^/api/v1/validate/*",
|
||||
"/api/v1/chat/*",
|
||||
"/api/v1/version",
|
||||
"/health",
|
||||
"^/build/*",
|
||||
];
|
||||
|
||||
// Use environment variable to determine the target.
|
||||
|
|
@ -20,11 +19,9 @@ const proxyTargets = apiRoutes.reduce((proxyObj, route) => {
|
|||
changeOrigin: true,
|
||||
secure: false,
|
||||
ws: true,
|
||||
rewrite: (path) => `/api/v1${path}`,
|
||||
};
|
||||
return proxyObj;
|
||||
}, {});
|
||||
|
||||
export default defineConfig(() => {
|
||||
return {
|
||||
build: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue