Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

select random ports if defaults are taken #695

Merged
merged 2 commits into from Jul 14, 2021

Conversation

mihkeleidast
Copy link
Contributor

Closes #429.

Changes

This adds support for multiple Astro dev servers running simultaneously. Previously, trying to start a second server errored out because the fixed default ports were already in use. Now, when the default ports are in use, a random port is chosen.

Testing

I've tested this manually by running two of the examples in the repo at the same time. Not sure if this can be automatically tested against, but if it needs to be, I would like some pointers.

Docs

Bug fix only.

@changeset-bot
Copy link

changeset-bot bot commented Jul 14, 2021

🦋 Changeset detected

Latest commit: bcaf089

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
astro Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Jul 14, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pikapkg/astro-www/Cjv2z7Lg2rdtP6VvmSP9moAkdE9V
✅ Preview: https://astro-www-git-fork-mihkeleidast-issue-429-pikapkg.vercel.app

Copy link
Member

@FredKSchott FredKSchott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, really appreciate the contribution! Will leave this for @natemoo-re or @matthewp to also review and then merge

Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thank you SO much for the contribution!

@natemoo-re natemoo-re merged commit fb8bf7e into withastro:main Jul 14, 2021
SiriousHunter pushed a commit to SiriousHunter/astro that referenced this pull request Feb 3, 2023
* select random port if default ports are taken

* add changeset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 BUG: Astro dev server with different ports don't select different HMR ports
3 participants