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
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/commands/dev/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,19 @@ class DevCommand extends Command {
settings = {
noCmd: true,
port: 8888,
proxyPort: 3999,
proxyPort: await getPort({ port: 3999 }),
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

settings = {
port: await getPort({ port: settings.port }),
...settings
};
}

startDevServer(settings, this.log);

// serve functions from zip-it-and-ship-it
Expand Down