Commit f6d485e 1 parent dd4ccfe commit f6d485e Copy full SHA for f6d485e
File tree 3 files changed +603
-101
lines changed
3 files changed +603
-101
lines changed Original file line number Diff line number Diff line change 2
2
import mongoose from 'mongoose' ;
3
3
import util from 'util' ;
4
4
5
+ import AirbrakeClient from 'airbrake-js' ;
6
+ import makeErrorHandler from 'airbrake-js/dist/instrumentation/express' ;
7
+
8
+
5
9
// config should be imported before importing any other file
6
10
import config from './config/config' ;
7
11
import app from './config/express' ;
@@ -40,6 +44,13 @@ if (config.MONGOOSE_DEBUG) {
40
44
// module.parent check is required to support mocha watch
41
45
// src: https://github.com/mochajs/mocha/issues/1912
42
46
if ( ! module . parent ) {
47
+ const airbrake = new AirbrakeClient ( {
48
+ projectId : 186736 ,
49
+ projectKey : 'ebfbb905ffdbcd115abddd5895cc13c7'
50
+ } ) ;
51
+
52
+ app . use ( makeErrorHandler ( airbrake ) ) ;
53
+
43
54
// listen on port config.port
44
55
app . listen ( config . port , ( ) => {
45
56
console . info ( `server started on port ${ config . port } (${ config . env } )` ) ; // eslint-disable-line no-console
You can’t perform that action at this time.
0 commit comments