Skip to content
This repository has been archived by the owner on Sep 12, 2019. It is now read-only.

Make ports for local server dynamic #205

Merged
merged 2 commits into from
Jul 8, 2019
Merged

Make ports for local server dynamic #205

merged 2 commits into from
Jul 8, 2019

Conversation

RaeesBhatti
Copy link
Contributor

- Summary

Allow the user to run more than one dev server at one time.

- Test plan

  • Run netlify dev in your project directory
  • Run netlify dev in a different project directory

- Description for the changelog

For the static server, we have moved from the absolute proxyPort: 3999 to getPort method that chooses an available port.
For the 8888 server port, we use dynamic port from getPort if the user hasn't specified port in their config.

- A picture of a cute animal (not mandatory but encouraged)
rusty-spotted-cat-kitten

@jschatz1
Copy link
Contributor

jschatz1 commented Jul 1, 2019

Beautiful.

@RaeesBhatti
Copy link
Contributor Author

@jschatz1 should I merge this?

Copy link
Contributor

@swyxio swyxio left a comment

Choose a reason for hiding this comment

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

pointed out a source of manual specification you may have missed. i believe that the way we handle config resolution is rife with easy to forget footguns, needs top down design.

dist
};
}

// Reset port if not manually specified, to make it dynamic
if (!(config.dev && config.dev.port)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

don't forget flags.port

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, thank you

@RaeesBhatti RaeesBhatti requested a review from swyxio July 8, 2019 15:22
@swyxio swyxio merged commit a84202c into netlify:master Jul 8, 2019
@RaeesBhatti RaeesBhatti deleted the patch-1 branch July 8, 2019 17:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants