-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
53 lines (46 loc) · 1.23 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
/*
* Breach: [mod_stats] index.js
*
* Copyright (c) 2014, Stanislas Polu. All rights reserved.
*
* @author: spolu
*
* @log:
* - 2014-06-26 spolu Creation
*/
"use strict"
var common = require('./lib/common.js');
var async = require('async');
var breach = require('breach_module');
/******************************************************************************/
/* MODULE BOOTSTRAP */
/******************************************************************************/
var bootstrap = function(http_srv) {
common._ = {
stats: require('./lib/stats.js').stats({})
};
breach.init(function() {
breach.register('core', 'inst:.*');
breach.expose('init', function(src, args, cb_) {
async.parallel([
common._.stats.init,
], cb_);
});
breach.expose('kill', function(args, cb_) {
async.parallel([
common._.stats.kill,
], function(err) {
common.exit(0);
});
});
});
};
/******************************************************************************/
/* SETUP */
/******************************************************************************/
(function setup() {
return bootstrap();
})();
process.on('uncaughtException', function (err) {
common.fatal(err);
});