-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.js
50 lines (36 loc) · 902 Bytes
/
app.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
/**
* Module dependencies.
*/
var namespace = require('express-namespace');
var pmx = require('pmx')
// pmx.http();
// pmx.catchAll();
pmx.probe().metric({
name : 'TEST AGG_TYPE',
agg_type: 'min',
value : function() {
return '12blih/s';
}
});
pmx.probe().metric({
name : 'NO AGG TYPE',
agg_type: 'none',
value : function() {
return 42;
}
});
var http = require('http');
var express = require('express');
// Load configurations
env = process.env.NODE_ENV || 'development'
config = require('./config/config')[env]
app = express();
require('./models/db')
require('./config/express')(app, config);
require('./config/routes').setup(app);
app.use(pmx.expressErrorHandler());
app.set('port', process.env.PORT || config.port);
app.listen(app.get('port'));
console.log('Express server listening on port ' + app.get('port'));
// expose app
exports = module.exports = app;