forked from ciderapp/Cider-Bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
local.js
56 lines (56 loc) · 1.54 KB
/
local.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
const isRailway = require('is-railway');
//require('./tokens.json')
// a
module.exports = {
token: function () {
if (isRailway()) {
return process.env.TOKEN;
} else {
return require('./tokens.json').token;
}
},
mongo: function () {
if (isRailway()) {
return `mongodb://${process.env.MONGOUSER}:${ process.env.MONGOPASSWORD }@${ process.env.MONGOHOST }:${ process.env.MONGOPORT }`;
} else {
return require('./tokens.json').mongo;
}
},
port: function () {
if (isRailway()) {
return process.env.PORT;
} else {
return require('./tokens.json').port;
}
},
expressurl: function () {
if (isRailway()) {
return process.env.URL;
} else {
return `${require('./tokens.json').url}:${require('./tokens.json').port}`;
}
},
auth: {
clientId: function () {
if (isRailway()) {
return process.env.AUTH_CLIENTID;
} else {
return require('./tokens.json').auth.clientId;
}
},
clientSecret: function () {
if (isRailway()) {
return process.env.AUTH_CLIENTSECRET;
} else {
return require('./tokens.json').auth.clientSecret;
}
},
},
ocKey: function () {
if (isRailway()){
return process.env.ocKey
} else {
return require('./tokens.json').ocKey;
}
}
}