-
Notifications
You must be signed in to change notification settings - Fork 7
/
environment.ts
25 lines (21 loc) · 1.11 KB
/
environment.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import {FilterSpecialValueAllInstances} from "../app/shared/constants";
function getEnvironmentVariable<T>(variable: string, defaultValue: T): T {
if (typeof window === 'undefined') {
return defaultValue;
}
if (typeof (<any>window)[variable] === 'undefined') {
return defaultValue;
}
return <T>(<any>window)[variable];
}
export const environment = {
apiUrl: getEnvironmentVariable('FEDISEER_API_URL', 'https://fediseer.com/api'),
apiVersion: getEnvironmentVariable('FEDISEER_API_VERSION', 'v1'),
appName: getEnvironmentVariable('FEDISEER_APP_NAME', 'FediseerGUI'),
appVersion: getEnvironmentVariable('FEDISEER_APP_VERSION', '0.18.3'),
maintainer: getEnvironmentVariable('FEDISEER_APP_MAINTAINER', '@rikudou@lemmings.world'),
defaultCensuresListInstanceFilter: getEnvironmentVariable('FEDISEER_DEFAULT_CENSURE_LIST_FILTER_INSTANCES', [FilterSpecialValueAllInstances]),
sourceCodeLink: getEnvironmentVariable('FEDISEER_SOURCE_CODE_LINK', 'https://github.com/Fediseer/FediseerGUI'),
donateLink: getEnvironmentVariable('FEDISEER_DONATE_LINK', 'https://liberapay.com/Fediseer/'),
production: true,
};