diff --git a/frontend/web/vite.config.ts b/frontend/web/vite.config.ts index cc570fa..28c6fab 100644 --- a/frontend/web/vite.config.ts +++ b/frontend/web/vite.config.ts @@ -2,6 +2,12 @@ import react from "@vitejs/plugin-react-swc"; import { resolve } from "path"; import { defineConfig } from "vite"; +let devProxyServer = "http://localhost:8082/"; +if (process.env.DEV_PROXY_SERVER && process.env.DEV_PROXY_SERVER.length > 0) { + console.log("Use devProxyServer from environment: ", process.env.DEV_PROXY_SERVER); + devProxyServer = process.env.DEV_PROXY_SERVER; +} + // https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], @@ -9,13 +15,17 @@ export default defineConfig({ host: "0.0.0.0", port: 3000, proxy: { - "/api/": { - target: "http://localhost:8082/", - changeOrigin: true, + "^/api": { + target: devProxyServer, + xfwd: true, }, - "/s/": { - target: "http://localhost:8082/", - changeOrigin: true, + "^/slash.api.v2": { + target: devProxyServer, + xfwd: true, + }, + "^/s/": { + target: devProxyServer, + xfwd: true, }, }, },