forked from algorithm-visualizer/algorithm-visualizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
environment.js
44 lines (34 loc) · 990 Bytes
/
environment.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
const path = require('path');
const {
NODE_ENV = 'production',
HTTP_PORT = '8080',
PROXY_PORT = '3000',
GITHUB_CLIENT_ID,
GITHUB_CLIENT_SECRET,
} = process.env;
const __PROD__ = NODE_ENV === 'production';
const __DEV__ = !__PROD__;
const httpPort = parseInt(HTTP_PORT);
const proxyPort = parseInt(PROXY_PORT);
const githubClientId = GITHUB_CLIENT_ID;
const githubClientSecret = GITHUB_CLIENT_SECRET;
const buildPath = path.resolve(__dirname, 'build');
const frontendBuildPath = path.resolve(buildPath, 'frontend');
const backendBuildPath = path.resolve(buildPath, 'backend');
const srcPath = path.resolve(__dirname, 'src');
const frontendSrcPath = path.resolve(srcPath, 'frontend');
const backendSrcPath = path.resolve(srcPath, 'backend');
const apiEndpoint = '/api';
module.exports = {
__PROD__,
__DEV__,
httpPort,
proxyPort,
githubClientId,
githubClientSecret,
frontendBuildPath,
backendBuildPath,
frontendSrcPath,
backendSrcPath,
apiEndpoint,
};