From f91ff7dc79d04068d89dbf2d6b0b620b505036c2 Mon Sep 17 00:00:00 2001 From: Aivars Francis Date: Wed, 22 Nov 2023 13:12:46 +0200 Subject: [PATCH] remove hard coded endpoint and create base endpoint constant --- src/utils/Types.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/utils/Types.ts b/src/utils/Types.ts index e161081..0e9eab3 100644 --- a/src/utils/Types.ts +++ b/src/utils/Types.ts @@ -8,9 +8,10 @@ export type Connection = { events: LimitedArray; }; -// export const endpoint = `${window.location.protocol}//${window.location.host}${window.location.pathname.replace(/\/+$/, '')}`; -export const endpoint = "http://localhost:2567" -export const client = new Client(endpoint); +export const baseEndpoint = `${window.location.protocol}//${window.location.host}`; +export const endpoint = `${baseEndpoint}${window.location.pathname.replace(/\/+$/, '')}`; + +export const client = new Client(baseEndpoint); export const global = { connections: [] as Connection[], };