-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathapp.js
More file actions
38 lines (26 loc) · 811 Bytes
/
app.js
File metadata and controls
38 lines (26 loc) · 811 Bytes
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
var log4js = require('log4js'),
logger = log4js.getLogger();
var path = require("path");
var argv = process.argv.slice(2);
if(argv.indexOf('--project') >= 0){
GLOBAL.pjconfig = require(path.join(__dirname , 'project.debug.json'));
}else {
GLOBAL.pjconfig = require(path.join(__dirname , 'project.json'));
}
if(argv.indexOf('--debug') >= 0){
logger.setLevel('DEBUG');
global.debug = true;
}else {
logger.setLevel('INFO');
}
GLOBAL.MONGODB = GLOBAL.pjconfig.mongodb;
var dispatcher = require(GLOBAL.pjconfig.acceptor.module)
, save = require('./storage/MongodbStorage');
// use zmq to dispatch
dispatcher()
.pipe(save());
logger.info('start badjs-storage success.');
setTimeout(function (){
require('./service/query')();
require('./service/autoClear')();
},1000);