Skip to content

Commit

Permalink
Merge pull request #1159 from blockscout/websocket-port
Browse files Browse the repository at this point in the history
add socket port
  • Loading branch information
isstuev authored Sep 8, 2023
2 parents 4d20dec + db5b0c1 commit e6ebf07
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion configs/app/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) || ''),
});

Expand Down

0 comments on commit e6ebf07

Please sign in to comment.