Hello, World! I'm trying to run a server with port...
# ktor
b
Hello, World! I'm trying to run a server with port
0
(dynamic random port) for tests, this seems to work (I see in the logs, e.g.:
Responding at <http://0.0.0.0:52025>
), but how do I get the port that was picked?
server.environment.connectors.first().port
returns
0
1
s
You might need to use
resolvedConnectors()
instead of
environment.connectors
b
haha yes I just saw it from here. And it does work! 🎉 Thanks a lot!