-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.example.js
45 lines (42 loc) · 1.05 KB
/
config.example.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
const fs = require('fs');
let botCSV = '';
try {
botCSV = fs.readFileSync('./bots.csv', 'utf8');
} catch (err) {
console.error(`No ./bots.csv found, please look at ./bots.example.csv`);
}
const bots = botCSV.split('\n').map(bot => {
const [language, personality, bot_key] = bot.split(',').map(a => a.trim());
return {
language,
personality,
bot_key
};
});
const config = {
"production": {
"slack":{
"client_secret":"xxxxxxxxxxxxxxxx",
"client_id":"xxxxxx.xxxxxxx"
},
"personalityServer": {
"host": "localhost",
"port": "8000",
"version": "v1"
},
"bots": bots
},
"development": {
"slack":{
"client_secret":"xxxxxxxxxxxxxxxx",
"client_id":"xxxxxx.xxxxxxx"
},
"personalityServer": {
"host": "localhost",
"port": "8000",
"version": "v1"
},
"bots": bots
}
};
module.exports = config[process.env.NODE_ENV || 'development'];