From e1b0faa18f3b6d7b365f5fc10caaecd6e480644d Mon Sep 17 00:00:00 2001 From: 4censord Date: Sat, 3 Aug 2024 15:21:44 +0200 Subject: [PATCH] Fall back to port 3000 if none is specified Originally, because `parseInt` can return `NaN`, sharkey would happily try to listen on port `NaN`. --- packages/backend/src/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/config.ts b/packages/backend/src/config.ts index 15fc6fff28..44b0a05f24 100644 --- a/packages/backend/src/config.ts +++ b/packages/backend/src/config.ts @@ -256,7 +256,7 @@ export function loadConfig(): Config { version, publishTarballInsteadOfProvideRepositoryUrl: !!config.publishTarballInsteadOfProvideRepositoryUrl, url: url.origin, - port: config.port ?? parseInt(process.env.PORT ?? '', 10), + port: config.port ?? parseInt(process.env.PORT ?? '3000', 10), socket: config.socket, chmodSocket: config.chmodSocket, disableHsts: config.disableHsts,