export const Config = { loginURL: get("loginURL", "http://localhost:8081/login"), logoutURL: get("logoutURL", "http://localhost:8081/logout"), graphQLEndpoint: get("graphQLEndpoint", "http://localhost:8081/api/v1/graphql"), subscriptionEndpoint: get("subscriptionEndpoint", "ws://localhost:8081/api/v1/graphql"), conferenceHeartbeatInterval: get("conferenceHeartbeatInterval", 10000), frontendBaseURL: get("frontendBaseURL", window.location.protocol + '//' + window.location.host + '/'), }; function get(key: string, defaultValue: T):T { const config = window['__CONFIG__'] || {}; if (config && config.hasOwnProperty(key)) { return config[key] as T; } else { return defaultValue; } }