-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
38 lines (36 loc) · 1.47 KB
/
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
let config = {
analyzer: {
host: process.env.ANALYZER_HOST || "localhost",
port: process.env.ANALYZER_PORT || 5000,
},
workloadProfiler: {
host: process.env.WORKLOAD_PROFILER_HOST || "localhost",
port: process.env.WORKLOAD_PROFILER_PORT || 7779,
},
operator: {
host: process.env.OPERATOR_HOST || "localhost",
port: process.env.OPERATOR_PORT || 8080,
},
mongo: {
host: process.env.MONGO_HOST || "localhost",
port: process.env.MONGO_PORT || 27017,
username: process.env.MONGO_USERNAME,
password: process.env.MONGO_PASSWORD,
configdbName: process.env.CONFIGDB_NAME || "configdb",
metricdbName: process.env.METRICDB_NAME || "metricdb",
mockdbName: process.env.CONFIGDB_NAME || "mockdb",
},
influx: {
host: process.env.INFLUXDB_HOST || "localhost",
port: process.env.INFLUXDB_PORT || 8086,
username: process.env.INFLUXDB_USERNAME || "root",
password: process.env.INFLUXDB_PASSWORD || "root",
},
};
config.analyzer.url = `http://${config.analyzer.host}:${config.analyzer.port}`;
config.workloadProfiler.url = `http://${config.workloadProfiler.host}:${config.workloadProfiler.port}`;
config.operator.url = `http://${config.operator.host}:${config.operator.port}`;
config.mongo.url = !!config.mongo.username && !!config.mongo.password
? `mongodb://${config.mongo.username}:${config.mongo.password}@${config.mongo.host}:${config.mongo.port}`
: `mongodb://${config.mongo.host}:${config.mongo.port}`;
module.exports = config;