Skip to content

Commit

Permalink
Simpler printing logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Joannis committed Oct 14, 2024
1 parent 467b0c8 commit c2e3da3
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Sources/HummingbirdCore/Server/Server.swift
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,20 @@ public actor Server<ChildChannel: ServerChildChannel>: Service {
logger: self.logger
)
}
self.logger.info("Server started and listening on \(host):\(asyncChannel.channel.localAddress?.port ?? port)")

var printableHostname = host

switch host {
case "0.0.0.0":
printableHostname = "127.0.0.1"
case "::":
printableHostname = "::1"
default:
()
}

self.logger.info("Server started and listening on http://\(printableHostname):\(asyncChannel.channel.localAddress?.port ?? port)")

return (asyncChannel, quiescingHelper)

case .unixDomainSocket(let path):
Expand Down

0 comments on commit c2e3da3

Please sign in to comment.