integration-fix
This commit is contained in:
18
index.mjs
18
index.mjs
@@ -12,6 +12,14 @@ const server = Server.configure({
|
||||
port,
|
||||
onConnect({ connection }) {
|
||||
connection.requiresAuthentication = true;
|
||||
const Sentry = require("@sentry/node");
|
||||
Sentry.init({ dsn: process.env.SENTRY_DSN });
|
||||
|
||||
const startServer = async () => {
|
||||
const server = await Server.configure({
|
||||
port: process.env.PORT || 4000,
|
||||
async onConnect({ connection }) {
|
||||
connection.requiresAuthentication = true;
|
||||
},
|
||||
onAuthenticate(data) {
|
||||
return new Promise((resolve, reject) => {
|
||||
@@ -116,4 +124,12 @@ const server = Server.configure({
|
||||
},
|
||||
});
|
||||
|
||||
server.listen().then(r => console.info('Server started'));
|
||||
process.on('unhandledRejection', (reason, promise) => {
|
||||
Sentry.captureException(reason);
|
||||
});
|
||||
|
||||
process.on('uncaughtException', (error) => {
|
||||
Sentry.captureException(error);
|
||||
});
|
||||
|
||||
startServer();
|
||||
|
Reference in New Issue
Block a user