This repository has been archived by the owner on Aug 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
env-config.js
54 lines (44 loc) · 1.75 KB
/
env-config.js
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// This file is evaluated when exporting the frontend application
// The environment variabled need to be set locally on in the CI/CD console
const LANG = process.env.APP_LANG || 'en';
const DEVELOPMENT = process.env.NODE_ENV !== 'production';
const COMMIT_SHA = process.env.COMMIT_SHA || 'development';
const VOCDONI_ENVIRONMENT = process.env.VOCDONI_ENVIRONMENT || 'dev';
const isTrueEnv = (env) => env === 'true' || env === true;
const VERIFY_SINGLE_PAGE = isTrueEnv(process.env.VERIFY_SINGLE_PAGE) || false;
let plaza, apiUrl;
switch (VOCDONI_ENVIRONMENT) {
case 'stg':
plaza = `https://app-stg.vocdoni.io`;
apiUrl = `https://api-stg.vocdoni.net/v2`;
break;
case 'prod':
plaza = `https://onvote.app`;
apiUrl = `https://api.vocdoni.net/v2`;
break;
default:
plaza = `https://app-dev.vocdoni.io`;
apiUrl = `https://api-dev.vocdoni.net/v2`;
break;
}
module.exports = {
COMMIT_SHA,
LANG,
DEVELOPMENT,
VOCDONI_ENVIRONMENT,
APP_TITLE: 'Vocdoni Explorer',
APP_DESCRIPTION:
'A graphical tool to explore the Vocdoni Blockchain, from organizations, processes and votes to discover lasts blocks, transactions, information about the state of the Blockchain and verify your vote.',
APP_TAGS: 'vocdoni, blockchain, explorer, organizations, processes, blocks, transactions, vote, votes',
VERIFY_SINGLE_PAGE,
// BLOCKCHAIN
ETH_NETWORK_ID: process.env.ETH_NETWORK_ID || 'goerli',
// VOCHAIN
BLOCK_TIME: process.env.BLOCK_TIME || '12',
// GATEWAYS
PLAZA_URL: process.env.PLAZA_URL || plaza, // Deprecated see https://github.com/vocdoni/explorer-ui/issues/163
API_URL: process.env.API_URL || apiUrl,
// HELPSCOUT
HELPSCOUT_PROJECT_ID: '', // TODO:
};
console.log('Building the frontend with ENV:', module.exports);