summary refs log tree commit diff
path: root/bundle/src/Server.ts
diff options
context:
space:
mode:
Diffstat (limited to 'bundle/src/Server.ts')
-rw-r--r--bundle/src/Server.ts33
1 files changed, 17 insertions, 16 deletions
diff --git a/bundle/src/Server.ts b/bundle/src/Server.ts

index 71a60d49..651e8e64 100644 --- a/bundle/src/Server.ts +++ b/bundle/src/Server.ts
@@ -33,7 +33,6 @@ process.on('SIGTERM', () => { //this is what has been added for the /stop API route async function main() { - server.listen(port); await initDatabase(); await Config.init(); // only set endpointPublic, if not already set @@ -50,20 +49,20 @@ async function main() { endpointPublic: `ws://localhost:${port}`, }), }, - // regions: { - // default: "fosscord", - // useDefaultAsOptimal: true, - // available: [ - // { - // id: "fosscord", - // name: "Fosscord", - // endpoint: "127.0.0.1:3001", - // vip: false, - // custom: false, - // deprecated: false, - // }, - // ], - // }, + regions: { + default: "fosscord", + useDefaultAsOptimal: true, + available: [ + { + id: "fosscord", + name: "Fosscord", + endpoint: "127.0.0.1:3004", + vip: false, + custom: false, + deprecated: false, + }, + ], + }, } as any); //Sentry @@ -84,7 +83,7 @@ async function main() { app.use(Sentry.Handlers.requestHandler()); app.use(Sentry.Handlers.tracingHandler()); } - await Promise.all([api.start(), cdn.start(), gateway.start()]); + if (Config.get().sentry.enabled) { app.use(Sentry.Handlers.errorHandler()); app.use(function onError(err: any, req: any, res: any, next: any) { @@ -92,6 +91,8 @@ async function main() { res.end(res.sentry + "\n"); }); } + + await Promise.all([api.start(), cdn.start(), gateway.start()]); console.log(`[Server] ${green(`listening on port ${bold(port)}`)}`); }