From ea61561bbd43096c09d9eead89cd3750106dd95e Mon Sep 17 00:00:00 2001 From: Jonathan Gustafsson Date: Thu, 19 Dec 2024 14:25:50 +0100 Subject: [PATCH] Fix: Sync UI Client with server port env --- client/vite.config.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/vite.config.ts b/client/vite.config.ts index e58c973caf..32d1e1b9fd 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/, ""), },