From 5bb2d0f284c576458fa071f2eb24bd2b49523db6 Mon Sep 17 00:00:00 2001 From: Michcio Date: Sun, 25 Sep 2022 18:49:55 +0200 Subject: [PATCH] Retouch types in server index --- packages/backend/src/server/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/server/index.ts b/packages/backend/src/server/index.ts index 4d3ae0043..9a897bc6d 100644 --- a/packages/backend/src/server/index.ts +++ b/packages/backend/src/server/index.ts @@ -138,13 +138,13 @@ export const startServer = () => { return server; }; -export default () => new Promise(resolve => { +export default (): Promise => new Promise(resolve => { const server = createServer(); initializeStreamingServer(server); server.on('error', e => { - switch ((e as any).code) { + switch ((e as NodeJS.ErrnoException).code) { case 'EACCES': serverLogger.error(`You do not have permission to listen on port ${config.port}.`); break; @@ -164,5 +164,5 @@ export default () => new Promise(resolve => { } }); - server.listen(config.port, resolve); + server.listen(config.port, () => resolve()); });