listen-fix
Some checks failed
CI/CD / test (push) Failing after 4s
CI/CD / deploy (push) Successful in 5s

This commit is contained in:
Untone 2024-04-09 20:16:27 +03:00
parent 723796f3a4
commit e848f40a6b

View File

@ -2,8 +2,8 @@ import { Authorizer } from "@authorizerdev/authorizer-js";
import { Server } from "@hocuspocus/server";
import Sentry from "@sentry/node";
const s = Sentry.init({ dsn: process.env.GLITCHTIP_DSN });
console.debug(s);
Sentry.init({ dsn: process.env.GLITCHTIP_DSN });
console.info("sentry initialized");
const port = process.env.PORT || 4000;
const authorizer = new Authorizer({
@ -11,7 +11,8 @@ const authorizer = new Authorizer({
authorizerURL: process.env.AUTHORIZER_URL || "https://auth.discours.io",
redirectURL: process.env.REDIRECT_URL || "https://testing.discours.io",
});
console.debug(authorizer);
console.info("authorizer initialized");
console.debug(authorizer.config.extraHeaders);
const startServer = async () => {
console.info("Starting server...");
@ -124,6 +125,7 @@ const startServer = async () => {
});
},
});
server.listen();
};
process.on("unhandledRejection", (reason, promise) => {
@ -133,4 +135,5 @@ process.on("unhandledRejection", (reason, promise) => {
process.on("uncaughtException", (error) => {
Sentry.captureException(error);
});
startServer();