github vapor/vapor 4.94.1
4.94.1 - Patch configuration and log actual port on startup

latest releases: 4.99.0, 4.98.0, 4.97.1...
13 days ago

What's Changed

Patch configuration and log actual port on startup by @bisgardo in #3160

Before this change, the application

let app = Application(.testing)
defer { app.shutdown() }
try app.server.start(hostname: nil, port: 0)
defer { app.server.shutdown() }

would log the following message before starting the server:

[Vapor] Server starting on http://127.0.0.1:0

After this change it instead logs a message like the following after starting the server:

[Vapor] Server starting on http://127.0.0.1:57935

The input configuration is also patched such that app.http.server.configuration.port will hold the actual port after startup. Currently if it has value 0 it will keep that value (only app.http.server.shared.localAddress?.port will have the correct one).

Fixes #3159.

Reviewers

Thanks to the reviewers for their help:

This patch was released by @0xTim

Full Changelog: 4.94.0...4.94.1

Don't miss a new vapor release

NewReleases is sending notifications on new releases.