mirror of
https://github.com/fromchat-messenger/web.git
synced 2026-09-22 19:15:08 +03:00
Add production deployment
This commit is contained in:
@@ -17,7 +17,7 @@ export const API_BASE_URL: string = '/api';
|
||||
* @type {string}
|
||||
* @constant
|
||||
*/
|
||||
export const API_FULL_BASE_URL: string = `${location.hostname}:8301/api`;
|
||||
export const API_FULL_BASE_URL: string = `${location.host}/api`;
|
||||
|
||||
/**
|
||||
* Application name displayed in UI and document title
|
||||
|
||||
@@ -27,7 +27,6 @@ body {
|
||||
}
|
||||
|
||||
mdui-dialog {
|
||||
|
||||
> *:first-child {
|
||||
margin-block-start: 0;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,12 @@ import { delay } from "./utils/utils";
|
||||
* @private
|
||||
*/
|
||||
function create(): WebSocket {
|
||||
return new WebSocket(`ws://${API_FULL_BASE_URL}/chat/ws`);
|
||||
let prefix = "ws://";
|
||||
if (location.protocol.includes("https")) {
|
||||
prefix = "wss://";
|
||||
}
|
||||
|
||||
return new WebSocket(`${prefix}${API_FULL_BASE_URL}/chat/ws`);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user