feat: with sentry node in dependensies and sentry dsn in index
This commit is contained in:
parent
bebfd46958
commit
4808d6d613
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();
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@authorizerdev/authorizer-js": "^2.0.0",
|
||||
"@hocuspocus/server": "^2.11.2"
|
||||
"@hocuspocus/server": "^2.11.2",
|
||||
"@sentry/node": "^6.14.0"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user