Set the server configuration address to an address with a nil port in configure.swift.
app.http.server.configuration.address = .hostname("0.0.0.0", port: nil)
I was trying to be able access the server from another device by explicitly opening all ports (following this: https://forums.raywenderlich.com/t/can-you-access-the-vapor-server-from-another-device-when-running-locally/52811). I ended getting this to work by using run arguments instead.
The server crashes while starting up. It looks like this crash is supposed to be avoided:

I think what you want is to use an actual port. Let's say 8000 and pass the hostname as 0.0.0.0 as you had. Then devices on the same network can connect by hitting 0.0.0.0:8000/my-route
This is likely a regression - setting the port to nil should use the default port, and shouldn’t crash here. The fix is easy, so I’ll submit a PR with a test later today since I’m likely the one that introduced it 😅
Regarding the issue you are seeing, I believe if you bind to localhost (the default), you are limiting connections to clients on the same machine the server is running on. By binding to 0.0.0.0, you aren't necessarily opening all ports, but opening connections on all _interfaces_ (for instance, connections coming from your WiFi or wired ethernet networks) — you'll still need a port for those clients to connect to though. The fix in #2479 addresses the crash and fixes this behavior where specifying a nil port will go ahead and use the default port, which is 8080.
Most helpful comment
Regarding the issue you are seeing, I believe if you bind to
localhost(the default), you are limiting connections to clients on the same machine the server is running on. By binding to0.0.0.0, you aren't necessarily opening all ports, but opening connections on all _interfaces_ (for instance, connections coming from your WiFi or wired ethernet networks) — you'll still need a port for those clients to connect to though. The fix in #2479 addresses the crash and fixes this behavior where specifying anilport will go ahead and use the default port, which is8080.