-
Notifications
You must be signed in to change notification settings - Fork 1
/
globals.ts
58 lines (47 loc) · 1.21 KB
/
globals.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
const debug = (...args) => console.log("core:globals ", ...args);
const config = {
default: {
pw_salt: "3rkjn34jfqknjnqgk5nkjenKJNJ$jtnqk",
},
development: {
port: 5050,
db: {
host: "localhost",
user: "root",
password: "password",
database: "makerbounty",
},
ro_db: {
host: "localhost",
user: "root",
password: "password",
database: "makerbounty",
}
},
production: {
port: 5050,
// todo, use production database..
db: {
host: "localhost",
user: "root",
password: "password",
database: "makerbounty",
},
ro_db: {
host: "localhost",
user: "root",
password: "password",
database: "makerbounty",
}
}
};
const env : string = process.env.NODE_ENV;
if (!config[env]) {
debug("Invalid/Missing environment configuration '%s'", env);
debug("Possible values for NODE_ENV are: %s", Object.keys(config).join(','));
process.exit(1);
}
export default {
...Object.assign(config.default, config[env]),
env
};