-
Notifications
You must be signed in to change notification settings - Fork 39
/
environment.ts
executable file
·34 lines (31 loc) · 1.03 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
26
27
28
29
30
31
32
33
34
import debug from 'debug';
import { CardanoEra, CardanoNetwork } from './constants';
const isNavigatorDefined = typeof navigator !== 'undefined';
export const environment = {
CARDANO: {
ERA: (process.env.CARDANO_ERA as CardanoEra) || CardanoEra.BYRON,
GRAPHQL: {
HTTP_URL: `${process.env.GRAPHQL_API_PROTOCOL || 'http'}://${
process.env.GRAPHQL_API_HOST ||
'localhost'
}:${process.env.GRAPHQL_API_PORT || '3100'}/${
process.env.GRAPHQL_API_PATH || ''
}`,
},
NETWORK:
(process.env.CARDANO_NETWORK as CardanoNetwork) || CardanoNetwork.MAINNET,
},
DEBUG: process.env.DEBUG,
// https://support.google.com/analytics/answer/7372977?hl=en
GA_TRACKING_ID: process.env.GA_TRACKING_ID,
IS_CLIENT: isNavigatorDefined,
IS_SERVER: !isNavigatorDefined,
PACKAGE: {
HOMEPAGE: process.env.PACKAGE_HOMEPAGE,
VERSION: process.env.PACKAGE_VERSION,
},
POLLING_INTERVAL: Number(process.env.POLLING_INTERVAL) || 10000,
};
if (environment.DEBUG) {
debug.enable(environment.DEBUG);
}