-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
56 lines (49 loc) · 1.32 KB
/
index.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
// neverdie
process.on('uncaughtException', function(err){
console.log('uncaughtException', new Date(), 'Caught exception: ' + err);
});
require('./lib/native-x');
var defaultConfig = {
sosTelnet:{
host: "127.0.0.1",
port: 2468
},
controlInterface:{
server:{
port: 3500
}
},
cmsInterface:{
server:{
bind: '0.0.0.0',
port: 3510
},
library:[
'/shared'
],
playlistFsLocation: __dirname + '/../ml-sos-cms-data/playlists'
},
database:{
fsLocation: __dirname + '/../ml-sos-cms-data/database'
}
}
var loadedConfig;
try{
loadedConfig = require(__dirname+'/config');
} catch(e){
console.log('************************************************************');
console.log('missing config.json, please add it, continuing with defaults');
console.log('************************************************************')
loadedConfig = {};
}
//load config or default config
var config = {}._xtend(defaultConfig, loadedConfig);
console.log(config);
// start database
var DB = require(__dirname+ '/lib/data')(config);
// start control interface
var controlInterface = require(__dirname+'/lib/control-interface')(config);
// start CMS interface
var cmsInterface = require(__dirname+'/lib/cms-interface')(config, DB);
// scrape FS for datasets and playlists
var scrapers = require(__dirname+'/lib/scrapers')(config, DB);