integration-fix
Some checks failed
CI/CD / test (push) Failing after 6s
CI/CD / deploy (push) Failing after 34s

This commit is contained in:
2024-04-08 10:51:11 +03:00
4 changed files with 23 additions and 215 deletions

View File

@@ -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();