2020-07-10 18:07:41 +02:00
|
|
|
export const Config = {
|
|
|
|
loginURL: get<string>("loginURL", "http://localhost:8081/login"),
|
|
|
|
logoutURL: get<string>("logoutURL", "http://localhost:8081/logout"),
|
|
|
|
graphQLEndpoint: get<string>("graphQLEndpoint", "http://localhost:8081/api/v1/graphql"),
|
2020-07-13 18:49:44 +02:00
|
|
|
subscriptionEndpoint: get<string>("subscriptionEndpoint", "ws://localhost:8081/api/v1/graphql"),
|
2020-07-10 18:07:41 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
function get<T>(key: string, defaultValue: T):T {
|
|
|
|
const config = window['__CONFIG__'] || {};
|
|
|
|
if (config && config.hasOwnProperty(key)) {
|
|
|
|
return config[key] as T;
|
|
|
|
} else {
|
|
|
|
return defaultValue;
|
|
|
|
}
|
|
|
|
}
|