forked from cardano-foundation/cardano-explorer-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
environment.ts
executable file
·34 lines (31 loc) · 1.07 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 || 'https'}://${
process.env.GRAPHQL_API_HOST ||
'cardano-graphql-mainnet.daedalus-operations.com'
}:${process.env.GRAPHQL_API_PORT || '443'}/${
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);
}