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

Dynamic port #383

Open
tobiasBora opened this issue Jun 10, 2024 · 0 comments
Open

Dynamic port #383

tobiasBora opened this issue Jun 10, 2024 · 0 comments

Comments

@tobiasBora
Copy link

tobiasBora commented Jun 10, 2024

If I specify:

start-server-and-test start-server http://localhost:8080 test

to start the webserver automatically, I need to know the port it will be using in advance. But by default, vite will pick the first port that is available (which I consider to be a good thing)… hence I cannot know in advance the code to port to use.

I'd love start-server-and-test to automatically detect the URL/port… not sure what is the best solution for this, but maybe using a (configurable) regexp to parse the first occurence of an url like http://localhost:5176/ in stdout would be a good solution. This URL should then automatically be forwarded to the script, I guess the simplest would be using an environment variable.

See also the related microsoft/playwright#31235

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

No branches or pull requests

1 participant