Dynamically Assigning and Discovering Ports with NodeHttpServer
Using NodeHttpServer with a dynamic port: I have an app that internally spins up a web server purely to be used for callbacks. I don't care what port it runs on, so long as it's one that's free and I can discover it to pass to the service that makes the call back. I've attempted to use both
0
0
and
undefined
undefined
in the
port
port
parameter to
NodeHttpServer.layer
NodeHttpServer.layer
, but in both cases I see nothing reported by
HttpServer.withLogAddress
HttpServer.withLogAddress
.
How might I: - Confirm whether or not the server is running? (if so, this confirms that
withLogAddress
withLogAddress
only works with static port assignments) - If running, discover the port it's running on?