🚚(collaboration) change the websocket url name

We will have 2 urls targeting the server, better
to improve the naming to avoid confusion.
This commit is contained in:
Anthony LC
2024-12-03 15:07:21 +01:00
committed by Anthony LC
parent 57ed08994b
commit aff036d9fb
8 changed files with 14 additions and 11 deletions

View File

@@ -6,7 +6,7 @@ import { createDoc } from './common';
const config = {
CRISP_WEBSITE_ID: null,
COLLABORATION_SERVER_URL: 'ws://localhost:4444',
COLLABORATION_WS_URL: 'ws://localhost:4444',
ENVIRONMENT: 'development',
FRONTEND_THEME: 'dsfr',
MEDIA_BASE_URL: 'http://localhost:8083',

View File

@@ -7,7 +7,7 @@ interface ConfigResponse {
LANGUAGES: [string, string][];
LANGUAGE_CODE: string;
ENVIRONMENT: string;
COLLABORATION_SERVER_URL?: string;
COLLABORATION_WS_URL?: string;
CRISP_WEBSITE_ID?: string;
FRONTEND_THEME?: Theme;
MEDIA_BASE_URL?: string;

View File

@@ -8,8 +8,10 @@ export const useCollaborationUrl = (room?: string) => {
}
const base =
conf?.COLLABORATION_SERVER_URL ||
(typeof window !== 'undefined' ? `wss://${window.location.host}/ws` : '');
conf?.COLLABORATION_WS_URL ||
(typeof window !== 'undefined'
? `wss://${window.location.host}/collaboration/ws/`
: '');
return `${base}/${room}`;
return `${base}?room=${room}`;
};