12 lines
243 B
JavaScript
12 lines
243 B
JavaScript
export function createWebSocket() {
|
|
let appUrl = process.env.APP_URL;
|
|
|
|
if (appUrl.includes('localhost')) {
|
|
appUrl = `//${appUrl}/chat-service`;
|
|
} else {
|
|
appUrl = `//${appUrl}/chat-service`;
|
|
}
|
|
|
|
return new WebSocket(appUrl);
|
|
}
|