mirror of
https://github.com/docmost/docmost.git
synced 2025-11-15 06:11:08 +10:00
feat: standalone collab server (#767)
* feat: standalone collab server * * custom collab server port env * fix collab start script command * * API prefix * Log startup PORT * Tweak collab debounce
This commit is contained in:
@ -19,15 +19,13 @@ export function getBackendUrl(): string {
|
||||
}
|
||||
|
||||
export function getCollaborationUrl(): string {
|
||||
const COLLAB_PATH = "/collab";
|
||||
const baseUrl =
|
||||
getConfigValue("COLLAB_URL") ||
|
||||
(import.meta.env.DEV ? process.env.APP_URL : getAppUrl());
|
||||
|
||||
let url = getAppUrl();
|
||||
if (import.meta.env.DEV) {
|
||||
url = process.env.APP_URL;
|
||||
}
|
||||
|
||||
const wsProtocol = url.startsWith("https") ? "wss" : "ws";
|
||||
return `${wsProtocol}://${url.split("://")[1]}${COLLAB_PATH}`;
|
||||
const collabUrl = new URL("/collab", baseUrl);
|
||||
collabUrl.protocol = collabUrl.protocol === "https:" ? "wss:" : "ws:";
|
||||
return collabUrl.toString();
|
||||
}
|
||||
|
||||
export function getAvatarUrl(avatarUrl: string) {
|
||||
|
||||
Reference in New Issue
Block a user