-
Notifications
You must be signed in to change notification settings - Fork 77
/
app.js
51 lines (34 loc) · 1.16 KB
/
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
51
var http = require('http');
//////////////////////////////////////////////////////////////////////////////////////////////
// Crash Report
//////////////////////////////////////////////////////////////////////////////////////////////
if(process.env.NODE_ENV === 'production') {
// Log to github
process.on('uncaughtException', function (err) {
var github = new (require('github'))({version: '3.0.0'});
github.authenticate({
type: 'oauth',
token: process.env.ADMIN_TOKEN
});
github.issues.create({
user: 'dtornow',
repo: 'review.ninja',
labels: ['crash'],
title: err.toString(),
body: err.stack.toString()
}, function() {
process.exit(1);
});
});
// Log to rollbar
var rollbar = require('rollbar');
rollbar.handleUncaughtExceptions('51d783b209fd4c24927dc5e0b1270aef', {
exitOnUncaughtException: false
});
}
//////////////////////////////////////////////////////////////////////////////////////////////
// Lift sails
//////////////////////////////////////////////////////////////////////////////////////////////
var app = require('./src/server/app.js');
http.createServer(app).listen(60000).on('listening', function() {
});