From fbb97e2a4954d80628d25be079a19e10a5797ca5 Mon Sep 17 00:00:00 2001 From: "gmh5225.eth" <13917777+gmh5225@users.noreply.github.com> Date: Fri, 3 Jan 2025 22:19:00 +0800 Subject: [PATCH] fix(client): improve Windows compatibility for Vite dev server - Add host configuration to allow IP access - Use explicit IP address instead of localhost - Support dynamic server port from environment variables --- client/vite.config.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/vite.config.ts b/client/vite.config.ts index 32d1e1b9fd..1cf014840e 100644 --- a/client/vite.config.ts +++ b/client/vite.config.ts @@ -27,9 +27,10 @@ export default defineConfig({ }, }, server: { + host: true, proxy: { "/api": { - target: `http://localhost:${process.env.SERVER_PORT || 3000}`, + target: `http://127.0.0.1:${process.env.SERVER_PORT || 3000}`, changeOrigin: true, rewrite: (path) => path.replace(/^\/api/, ""), },