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

Warn user when something else is already running on port 3000 #767

Closed
TimonVS opened this issue Nov 13, 2018 · 5 comments
Closed

Warn user when something else is already running on port 3000 #767

TimonVS opened this issue Nov 13, 2018 · 5 comments

Comments

@TimonVS
Copy link
Contributor

TimonVS commented Nov 13, 2018

Feature Request

Is your feature request related to a problem? Please describe.

When running Probot locally and you've already got something else running on port 3000 (Create React App and many other tools use 3000 by default) Probot will log "Not Found" errors when a webhook event is received.

image

Describe the solution you'd like

It'd be nice if Probot would detect if a something is already running on port 3000. Create React App does this as well:

image

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Teachability, Documentation, Adoption, Migration Strategy
If you can, explain how users will be able to use this and possibly write out a version the docs.
Maybe a screenshot or design?

@welcome
Copy link

welcome bot commented Nov 13, 2018

Thanks for opening this issue. A contributor should be by to give feedback soon. In the meantime, please check out the contributing guidelines and explore other ways you can get involved.

@NikhilM98
Copy link
Contributor

I was planning to work on this issue. It'll be my second issue on Probot after #778 so I'm open to suggestions. This would be a nice feature to the Probot.

The file probot/src/index.ts contains the Probot class. It creates a new express server on the specified port from the options. I was planning to catch errors on this.server.listen and if EADDRINUSE error is present then we'll tell the user that "maybe the port is already used. Would you like to use another port?" If the user inputs YES then we'll increment the port number by 1 and call this.server.listen again and then we'll start the webhook proxy.

I'm looking forward to feedback.

@JasonEtco
Copy link
Member

@NikhilM98 excited to see you contribute again!

I think your proposed implementation would be more than is necessary. That flow of incrementing the port would add a good amount of code; in my experience, when I see an EADDRINUSE error its usually because I forgot to close a server, so I just go and do that.

Instead, how about catching that error and printing a message like:

Port {{ port }} is already in use. You can define the PORT environment variable to use a different port.

@NikhilM98
Copy link
Contributor

Thanks, @JasonEtco for the feedback.

I've made a PR following the changes you requested.

@stale
Copy link

stale bot commented Feb 9, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Feb 9, 2019
@stale stale bot closed this as completed Feb 16, 2019
FoseFx added a commit to FoseFx/probot that referenced this issue Jul 11, 2020
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

3 participants