feat: with sentry node in dependensies and sentry dsn in index
This commit is contained in:
11
index.mjs
11
index.mjs
@@ -7,6 +7,9 @@ const authorizer = new Authorizer({
|
||||
redirectURL: 'https://testing.discours.io',
|
||||
});
|
||||
|
||||
const Sentry = require("@sentry/node");
|
||||
Sentry.init({ dsn: 'https://c98cd247c6744938a4daf0b3118722a2@glitchtip.discours.io/4' });
|
||||
|
||||
const startServer = async () => {
|
||||
const server = await Server.configure({
|
||||
port: process.env.PORT || 4000,
|
||||
@@ -39,4 +42,12 @@ const startServer = async () => {
|
||||
server.listen();
|
||||
};
|
||||
|
||||
process.on('unhandledRejection', (reason, promise) => {
|
||||
Sentry.captureException(reason);
|
||||
});
|
||||
|
||||
process.on('uncaughtException', (error) => {
|
||||
Sentry.captureException(error);
|
||||
});
|
||||
|
||||
startServer();
|
||||
|
Reference in New Issue
Block a user