Merge branch 'master' of github.com:spotify/backstage into shmidt-i/backend-hmr-2
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@backstage/plugin-sentry-backend",
|
||||
"version": "0.1.1-alpha.7",
|
||||
"version": "0.1.1-alpha.8",
|
||||
"main": "dist",
|
||||
"types": "src/index.ts",
|
||||
"license": "Apache-2.0",
|
||||
@@ -15,7 +15,7 @@
|
||||
"clean": "backstage-cli clean"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/backend-common": "^0.1.1-alpha.7",
|
||||
"@backstage/backend-common": "^0.1.1-alpha.8",
|
||||
"axios": "^0.19.2",
|
||||
"compression": "^1.7.4",
|
||||
"cors": "^2.8.5",
|
||||
@@ -28,7 +28,7 @@
|
||||
"yn": "^4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.1.1-alpha.7",
|
||||
"@backstage/cli": "^0.1.1-alpha.8",
|
||||
"jest-fetch-mock": "^3.0.3",
|
||||
"tsc-watch": "^4.2.3"
|
||||
},
|
||||
|
||||
@@ -13,4 +13,5 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './service/router';
|
||||
|
||||
@@ -22,13 +22,19 @@ export async function createRouter(logger: Logger): Promise<express.Router> {
|
||||
const router = Router();
|
||||
const SENTRY_TOKEN = process.env.SENTRY_TOKEN;
|
||||
if (!SENTRY_TOKEN) {
|
||||
throw new Error(
|
||||
'Sentry token must be provided in SENTRY_TOKEN environment variable to start the API.',
|
||||
if (process.env.NODE_ENV !== 'development') {
|
||||
throw new Error(
|
||||
'Sentry token must be provided in SENTRY_TOKEN environment variable to start the API.',
|
||||
);
|
||||
}
|
||||
logger.warn(
|
||||
'Failed to initialize Sentry backend, set SENTRY_TOKEN environment variable to start the API.',
|
||||
);
|
||||
}
|
||||
const sentryForwarder = getSentryApiForwarder(SENTRY_TOKEN, logger);
|
||||
} else {
|
||||
const sentryForwarder = getSentryApiForwarder(SENTRY_TOKEN, logger);
|
||||
|
||||
router.use(sentryForwarder);
|
||||
router.use(sentryForwarder);
|
||||
}
|
||||
|
||||
return router;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user