forked from agenda/agenda-rest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.js
57 lines (55 loc) · 1.02 KB
/
settings.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
55
56
57
let dbname = process.env.DB_NAME || "agenda";
let dbhost = process.env.DB_HOST || "localhost";
let dburi = process.env.DB_URI || null;
let appId = process.env.API_KEY;
let collection = "agendaJobs";
let definitions = "jobDefinitions";
let timeout = 5000;
const settings = {
get agendaMongoUrl() {
return dburi ? dburi : `mongodb://${dbhost}/${dbname}`;
},
get dbname() {
return dbname;
},
set dbname(value) {
dbname = value;
},
get dburi() {
return dburi;
},
set dburi(value) {
dburi = value;
},
get dbhost() {
return dbhost;
},
set dbhost(value) {
dbhost = value;
},
get collection() {
return collection;
},
set collection(value) {
collection = value;
},
get definitions() {
return definitions;
},
set definitions(value) {
definitions = value;
},
get timeout() {
return timeout;
},
set timeout(value) {
timeout = value;
},
get appId() {
return appId;
},
set appId(value) {
appId = value;
},
};
module.exports = settings;