From db5b0c1248a496ff6be2ace6a694b0e46359d884 Mon Sep 17 00:00:00 2001 From: isstuev Date: Fri, 8 Sep 2023 12:24:46 -0300 Subject: [PATCH] add socket port --- configs/app/api.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/configs/app/api.ts b/configs/app/api.ts index db87703633..f8e6512f8c 100644 --- a/configs/app/api.ts +++ b/configs/app/api.ts @@ -11,12 +11,19 @@ const apiEndpoint = [ apiHost, apiPort && ':' + apiPort, ].filter(Boolean).join(''); + const socketSchema = getEnvValue(process.env.NEXT_PUBLIC_API_WEBSOCKET_PROTOCOL) || 'wss'; +const socketEndpoint = [ + socketSchema, + '://', + apiHost, + apiPort && ':' + apiPort, +].filter(Boolean).join(''); const api = Object.freeze({ host: apiHost, endpoint: apiEndpoint, - socket: `${ socketSchema }://${ apiHost }`, + socket: socketEndpoint, basePath: stripTrailingSlash(getEnvValue(process.env.NEXT_PUBLIC_API_BASE_PATH) || ''), });