Commit db5b0c12 authored by isstuev's avatar isstuev

add socket port

parent c3676134
...@@ -11,12 +11,19 @@ const apiEndpoint = [ ...@@ -11,12 +11,19 @@ const apiEndpoint = [
apiHost, apiHost,
apiPort && ':' + apiPort, apiPort && ':' + apiPort,
].filter(Boolean).join(''); ].filter(Boolean).join('');
const socketSchema = getEnvValue(process.env.NEXT_PUBLIC_API_WEBSOCKET_PROTOCOL) || 'wss'; const socketSchema = getEnvValue(process.env.NEXT_PUBLIC_API_WEBSOCKET_PROTOCOL) || 'wss';
const socketEndpoint = [
socketSchema,
'://',
apiHost,
apiPort && ':' + apiPort,
].filter(Boolean).join('');
const api = Object.freeze({ const api = Object.freeze({
host: apiHost, host: apiHost,
endpoint: apiEndpoint, endpoint: apiEndpoint,
socket: `${ socketSchema }://${ apiHost }`, socket: socketEndpoint,
basePath: stripTrailingSlash(getEnvValue(process.env.NEXT_PUBLIC_API_BASE_PATH) || ''), basePath: stripTrailingSlash(getEnvValue(process.env.NEXT_PUBLIC_API_BASE_PATH) || ''),
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment