From bbd7281523e058ea52c5b54f181f147dc6a700ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anne=20L=27H=C3=B4te?= Date: Thu, 18 Jan 2024 17:57:24 +0100 Subject: [PATCH] fix ws port --- client/.env.staging | 3 ++- client/src/pages/index.jsx | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/client/.env.staging b/client/.env.staging index d28c5938..b2dc595c 100644 --- a/client/.env.staging +++ b/client/.env.staging @@ -1,2 +1,3 @@ VITE_HEADER_TAG=staging -VITE_WS_HOST=wss://localhost:443 \ No newline at end of file +VITE_WS_HOST=ws://localhost +VITE_WS_PORT=8080 \ No newline at end of file diff --git a/client/src/pages/index.jsx b/client/src/pages/index.jsx index db39d094..73130424 100644 --- a/client/src/pages/index.jsx +++ b/client/src/pages/index.jsx @@ -27,7 +27,7 @@ import { status } from '../config'; import 'primereact/resources/primereact.min.css'; import 'primereact/resources/themes/lara-light-indigo/theme.css'; -const { VITE_WS_HOST } = import.meta.env; +const { VITE_WS_HOST, VITE_WS_PORT } = import.meta.env; export default function Home() { const [allAffiliations, setAllAffiliations] = useState([]); @@ -48,7 +48,7 @@ export default function Home() { cacheTime: Infinity, }); - useWebSocket(VITE_WS_HOST, { + useWebSocket(`${VITE_WS_HOST}:${VITE_WS_PORT}`, { onMessage: (message) => setCurrent(Number(message.data) + 1), share: true, });