Commit 4c0924f2 by Jun Matsushita

Register sentry error handlers last

parent 2a9a41e6
Pipeline #2706 passed with stages
in 8 minutes 9 seconds
......@@ -57,9 +57,6 @@ console.log('API_URL: ' + API_URL);
const app = new Express()
.use(process.env.SENTRY_DSN ? sentry(service, release, describe).requestHandler() : id_middleware)
.use(process.env.SENTRY_DSN ? sentry(service, release, describe).errorHandler() : id_middleware)
.use(process.env.SENTRY_DSN ? onError : id_middleware)
// .use(process.env.NODE_ENV === 'PRODUCTION' ? helmet() : id_middleware)
.use(process.env.NODE_ENV === 'DEVELOPMENT' ? morgan('combined') : id_middleware);
const apiProxy = proxy({ target: `${API_HOST}:${API_PORT}`, changeOrigin: true });
......@@ -169,6 +166,10 @@ app.use((req, res) => {
});
});
app.use(process.env.SENTRY_DSN ? sentry(service, release, describe).errorHandler() : id_middleware);
app.use(process.env.SENTRY_DSN ? onError : id_middleware);
// .use(process.env.NODE_ENV === 'PRODUCTION' ? helmet() : id_middleware)
app.listen(PORT, () =>
console.log(
// eslint-disable-line no-console
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment