From 395b8b19a110b084969bd0b186ded3e73a4b66a7 Mon Sep 17 00:00:00 2001 From: ndcroos Date: Mon, 29 Jul 2024 00:17:39 +0200 Subject: [PATCH] vite changes --- vite.config.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index 42d7ab7..dd25d42 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -3,6 +3,9 @@ import react from '@vitejs/plugin-react-swc' import { viteStaticCopy } from 'vite-plugin-static-copy' import svgr from "vite-plugin-svgr" +const backendPort = process.env.PORT || 8080; +const clientPort = process.env.CLIENT_PORT || 3000; + // https://vitejs.dev/config/ export default defineConfig({ //root: 'client/src', @@ -32,20 +35,20 @@ export default defineConfig({ exclude: ['games'] }, server: { - port: 3000, + port: Number(clientPort), proxy: { '/websocket': { - target: 'ws://localhost:8080', + target: `ws://localhost:${backendPort}`, ws: true }, '/import': { - target: 'http://localhost:8080', + target: `ws://localhost:${backendPort}`, }, '/data': { - target: 'http://localhost:8080', + target: `ws://localhost:${backendPort}`, }, '/i18n': { - target: 'http://localhost:8080', + target: `ws://localhost:${backendPort}`, }, } },