-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Use next available port instead of hardcoded as default when using run
command
#68
Comments
@achou11 Any alternative to |
So TypeScript is configured to build Which results in the following built javascript: I.e. using Yes, I have tried changing |
Looks like @davidmarkclements has done a version of it here https://github.com/davidmarkclements/get-port/blob/master/index.js EDIT: Nope, this isn't the code. It does something else and the repository is even gone from github :/ |
@ralphtheninja if trying to get a closest match to a preferred port isn't a requirement, pretty sure you can let Express use Node's default behavior of choosing a random available port by specifying Docs from Express v4 ![]()
|
I found |
Running
webxdc-dev run ...
without using the--port
flag results in the following error on my machine:Error: listen EADDRINUSE: address already in use :::7000
Looks like this comment didn't age too well 😅 :
webxdc-dev/CHANGELOG.md
Line 295 in 0b9fafe
Instead of a hardcoded port as the default, I would suggest using a module like https://github.com/sindresorhus/get-port to get the next available port if the preferred one isn't available.
The text was updated successfully, but these errors were encountered: