Skip to content

Commit f6d485e

Browse files
committed
airbreak
1 parent dd4ccfe commit f6d485e

File tree

3 files changed

+603
-101
lines changed

3 files changed

+603
-101
lines changed

index.js

+11
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
import mongoose from 'mongoose';
33
import util from 'util';
44

5+
import AirbrakeClient from 'airbrake-js';
6+
import makeErrorHandler from 'airbrake-js/dist/instrumentation/express';
7+
8+
59
// config should be imported before importing any other file
610
import config from './config/config';
711
import app from './config/express';
@@ -40,6 +44,13 @@ if (config.MONGOOSE_DEBUG) {
4044
// module.parent check is required to support mocha watch
4145
// src: https://github.com/mochajs/mocha/issues/1912
4246
if (!module.parent) {
47+
const airbrake = new AirbrakeClient({
48+
projectId: 186736,
49+
projectKey: 'ebfbb905ffdbcd115abddd5895cc13c7'
50+
});
51+
52+
app.use(makeErrorHandler(airbrake));
53+
4354
// listen on port config.port
4455
app.listen(config.port, () => {
4556
console.info(`server started on port ${config.port} (${config.env})`); // eslint-disable-line no-console

0 commit comments

Comments
 (0)