From 7761c764b51ed95ce58296b885e54c9e2e704859 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20=C5=81=C4=85giewka?= Date: Fri, 10 Oct 2025 20:59:38 +0200 Subject: [PATCH] Bugfix/fix server startup message to properly display IPv6 addresses (#5716) * Fix server startup message to properly display IPv6 addresses * Update changelog --- CHANGELOG.md | 4 ++++ apps/api/src/main.ts | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f9a053ff..197bcdac5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Refactored various components to use self-closing tags +### Fixed + +- Fixed the server startup message to properly display IPv6 addresses + ## 2.207.0 - 2025-10-08 ### Added diff --git a/apps/api/src/main.ts b/apps/api/src/main.ts index 41f156cbf..a8de3dc5e 100644 --- a/apps/api/src/main.ts +++ b/apps/api/src/main.ts @@ -90,7 +90,21 @@ async function bootstrap() { await app.listen(PORT, HOST, () => { logLogo(); - Logger.log(`Listening at http://${HOST}:${PORT}`); + + let address = app.getHttpServer().address(); + + if (typeof address === 'object') { + const addressObject = address; + let host = addressObject.address; + + if (addressObject.family === 'IPv6') { + host = `[${addressObject.address}]`; + } + + address = `${host}:${addressObject.port}`; + } + + Logger.log(`Listening at http://${address}`); Logger.log(''); }); }