95eff42dfe
Co-authored-by: Lala, Shahd <Shahd.Lala@sybit.de> Co-authored-by: shahdlala66 <shahd.lala66@gmail.com> Reviewed-on: #8
14 lines
472 B
TypeScript
14 lines
472 B
TypeScript
/**
|
|
* Load runtime configuration from window.__RUNTIME_CONFIG__
|
|
* This is injected by docker-entrypoint.sh at container startup
|
|
*/
|
|
export function loadRuntimeConfig() {
|
|
const config = (window as any).__RUNTIME_CONFIG__ || {};
|
|
const wsProtocol = window.location.protocol === 'https:' ? 'wss' : 'ws';
|
|
const derivedWsUrl = `${wsProtocol}://${window.location.host}`;
|
|
return {
|
|
apiUrl: config.API_URL || '',
|
|
wsUrl: config.WEBSOCKET_URL || derivedWsUrl
|
|
};
|
|
}
|