Skip to content

Commit

Permalink
Fix: Sync UI Client with server port env
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathangus committed Dec 19, 2024
1 parent 86005ad commit ea61561
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion client/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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/, ""),
},
Expand Down

0 comments on commit ea61561

Please sign in to comment.