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

Include the listening port number in the server object #1053

Closed

Conversation

doughamlin
Copy link

What kind of change does this PR introduce?
feature

Did you add or update the examples/?
no

Summary
Exposes the listening port number in the server object.
Implements request in #998.

Does this PR introduce a breaking change?
No

@jsf-clabot
Copy link

jsf-clabot commented Aug 24, 2017

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Aug 24, 2017

Codecov Report

Merging #1053 into master will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1053      +/-   ##
==========================================
+ Coverage   72.25%   72.31%   +0.05%     
==========================================
  Files           4        4              
  Lines         465      466       +1     
  Branches      139      139              
==========================================
+ Hits          336      337       +1     
  Misses        129      129
Impacted Files Coverage Δ
lib/Server.js 79.87% <100%> (+0.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0b4729f...7095f82. Read the comment docs.

@doughamlin
Copy link
Author

I just realized this doesn't fully address the request in #998 because there is no listening event. It is easy enough to extend Server from EventEmitter and emit the listening event when the server starts listening, but I question the need for that when the server object is accessible inside the server.listen callback.

@shellscape
Copy link
Contributor

shellscape commented Aug 28, 2017

Much appreciate you taking the time to open a PR 🍻 however #998 seems to me to request automatic port assignment, along with making the random port assigned available for inspection, rather than just exposing the port assigned. I'm not sure you're on the same page as the issue author here.

Check out #1054

@doughamlin
Copy link
Author

doughamlin commented Aug 28, 2017

@shellscape Yeah, I don't know why I thought portfinder was already being used in lib/Server.js and thus all that was needed was exposing the port.

@shellscape
Copy link
Contributor

closing in favor of #1054. thanks again for the PR.

@doughamlin I think portfinder is still needed to check to see if the specified port is in use.

@shellscape shellscape closed this Aug 29, 2017
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

Successfully merging this pull request may close these issues.

None yet

3 participants