From e848f40a6ba409feec9268a0fe9ef868b59abfcd Mon Sep 17 00:00:00 2001 From: Untone Date: Tue, 9 Apr 2024 20:16:27 +0300 Subject: [PATCH] listen-fix --- index.mjs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/index.mjs b/index.mjs index c4645d7..94aea07 100644 --- a/index.mjs +++ b/index.mjs @@ -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();