Moved Bugsnag token into envvar

This commit is contained in:
Jori Lallo 2017-10-15 16:51:25 -07:00
parent d4dc6f2a28
commit 275e754bf1
3 changed files with 9 additions and 16 deletions

View File

@ -6,10 +6,7 @@
"plugin:import/warnings",
"plugin:flowtype/recommended"
],
"plugins": [
"prettier",
"flowtype"
],
"plugins": ["prettier", "flowtype"],
"rules": {
"eqeqeq": 2,
"no-unused-vars": 2,
@ -22,7 +19,7 @@
"import/no-unresolved": [
"error",
{
"ignore": [ "slate-drop-or-paste-images" ]
"ignore": ["slate-drop-or-paste-images"]
}
],
// Flow
@ -33,14 +30,8 @@
"annotationStyle": "line"
}
],
"flowtype/space-after-type-colon": [
2,
"always"
],
"flowtype/space-before-type-colon": [
2,
"never"
],
"flowtype/space-after-type-colon": [2, "always"],
"flowtype/space-before-type-colon": [2, "never"],
// Enforce that code is formatted with prettier.
"prettier/prettier": [
"error",
@ -65,7 +56,8 @@
"SLACK_REDIRECT_URI": true,
"DEPLOYMENT": true,
"BASE_URL": true,
"BUGSNAG_KEY": true,
"afterAll": true,
"Bugsnag": true
}
}
}

View File

@ -3,5 +3,6 @@ declare var __DEV__: string;
declare var SLACK_REDIRECT_URI: string;
declare var SLACK_KEY: string;
declare var BASE_URL: string;
declare var BUGSNAG_KEY: ?string;
declare var DEPLOYMENT: string;
declare var Bugsnag: any;

View File

@ -65,8 +65,8 @@ if (process.env.NODE_ENV === 'development') {
app.use(logger());
}
if (process.env.NODE_ENV === 'production') {
bugsnag.register('ad7a85f99b1b9324a31e16732cdf3192');
if (process.env.NODE_ENV === 'production' && process.env.BUGSNAG_KEY) {
bugsnag.register(process.env.BUGSNAG_KEY);
app.on('error', bugsnag.koaHandler);
}