lukeed / sirv

An optimized middleware & CLI application for serving static files~!
MIT License
1.06k stars 56 forks source link

[feature] option to fail on port conflict #137

Open sbeckeriv opened 2 years ago

sbeckeriv commented 2 years ago

Dearest Maintainer,

I have a build script that runs this. It creates a forked processes that it does not kill. the command it runs is sirv public --no-clear "--dev" "--port" "8080" after rebooting from a lack of memory i realized when i would run my code it would open a new port. ➡ Port 8080 is taken; using 33045 instead I would like to see an error if the port I requested is in use. Suggest a new port but error?

Thanks for your on this project. Becker

brunnerh commented 1 year ago

An option to just wait for the port to free up would also be helpful. If a build script restarts the server, it is not helpful if the application all of a sudden runs on a separate port.