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

Automatically use a different port if something is running on port 3000 already #114

Open
GrilloPress opened this issue May 8, 2019 · 2 comments
Labels
JavaScript Pull requests that update Javascript code type: enhancement 💡 New feature or request

Comments

@GrilloPress
Copy link
Contributor

Not a hot burning issue but something that caught me out.

I have a few prototypes for different parts of the programme and across NHS Digital.

Occasionally I find myself running two prototypes that either connect together or I need to evaluate against each other.

Doing this I noticed that you can't run two versions of the prototype kit at once.

It appears initially that you can (one running on port :3000 and :3001 but actually you are only getting port :2000 being proxied.

Prototype one

image

Prototype two

image

The proxy URLs are the different, but the proxied port is not. You see two prototypes running but only one is. This is the same in the browser. 2000, 3000 and 3001 are all the same prototype.

I could change this in one prototype manually to not run on 2000 in app/config.js, but I was wondering how easy it would be to run a check on 2000 and if used, run on 2001?

@GrilloPress GrilloPress changed the title Can't run two versions of a prototype at once Can't run two versions of a prototype kit at once May 9, 2019
@frankieroberto frankieroberto changed the title Can't run two versions of a prototype kit at once Automatically use a different port if something is running on port 300 already Nov 5, 2024
@frankieroberto
Copy link
Contributor

@GrilloPress sorry for the, err, 4 year delay - but thanks for reporting this!

I think we can add some code so that it’ll automatically switch to a different available port if needed.

Here’s the code that the GOVUK prototype kit uses for this: https://github.com/alphagov/govuk-prototype-kit/blob/main/lib/utils/index.js#L93-L130 - we should be able to copy that across to the NHS prototype kit.

@frankieroberto frankieroberto added the type: enhancement 💡 New feature or request label Nov 5, 2024
@frankieroberto frankieroberto changed the title Automatically use a different port if something is running on port 300 already Automatically use a different port if something is running on port 3000 already Nov 5, 2024
@vickytnz vickytnz added the JavaScript Pull requests that update Javascript code label Nov 24, 2024
@vickytnz
Copy link
Contributor

vickytnz commented Dec 4, 2024

As a note - if we do this it will be good to add documentation to the website about it to keep parity with the GOV.UK Prototype Kit website https://prototype-kit.service.gov.uk/docs/run-multiple-prototypes . Not going to start this until the feature is likely to go live but will be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JavaScript Pull requests that update Javascript code type: enhancement 💡 New feature or request
Development

No branches or pull requests

3 participants