diff --git a/client/vite.config.ts b/client/vite.config.ts index e58c973caf9..32d1e1b9fd3 100644 --- a/client/vite.config.ts +++ b/client/vite.config.ts @@ -3,6 +3,9 @@ import { defineConfig } from "vite"; import topLevelAwait from "vite-plugin-top-level-await"; import react from "@vitejs/plugin-react"; import wasm from "vite-plugin-wasm"; +import { config } from "dotenv"; + +config({ path: path.resolve(__dirname, "../.env") }); // https://vite.dev/config/ export default defineConfig({ @@ -26,7 +29,7 @@ export default defineConfig({ server: { proxy: { "/api": { - target: "http://localhost:3000", + target: `http://localhost:${process.env.SERVER_PORT || 3000}`, changeOrigin: true, rewrite: (path) => path.replace(/^\/api/, ""), },