Fall back to port 3000 if none is specified

Originally, because `parseInt` can return `NaN`, sharkey would happily
try to listen on port `NaN`.
This commit is contained in:
4censord 2024-08-03 15:21:44 +02:00
parent 12aeaa5f95
commit e1b0faa18f
No known key found for this signature in database
GPG Key ID: C8E54F9D13822E41
1 changed files with 1 additions and 1 deletions

View File

@ -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,