Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Merge requests
  • !100

[WIP] Use a different port if 3000 is used

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/sotojuan/port into master Jul 22, 2016
  • Overview 3
  • Commits 2
  • Pipelines 0
  • Changes 3

Created by: sotojuan

Work in progress!

Fixes #85 (closed).

The idea is to detect if port 3000 is used by something else and if so, use a different port.

portfinder takes in a basePort and returns that if it's available. If not, it'll use the next available port. This was a good solution because we can use 3000 as the basePort.

The problem is that while I can pass the port to the function that opens the browser, I can't pass it to the function that logs The app is running at http://localhost:3000/.

Assuming this UX is fine (@gaearon wanted a prompt, but I feel like this is less intrusive), how can I let the logging functions know about the new port?

Thanks!

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/sotojuan/port