Browse Source

fix(api): print v6 address URL in brackets

This allows to click and open from the log since v6 addresses are now
properly formatted.
pull/5716/head
Szymon Łągiewka 3 weeks ago
parent
commit
c7f14ee255
Failed to extract signature
  1. 12
      apps/api/src/main.ts

12
apps/api/src/main.ts

@ -90,7 +90,17 @@ 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 addressObj = address;
let host = addressObj.address;
if (addressObj.family === 'IPv6') {
host = `[${addressObj.address}]`;
}
address = `${host}:${addressObj.port}`;
}
Logger.log(`Listening at http://${address}`);
Logger.log('');
});
}

Loading…
Cancel
Save