FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

doc: fix inconsistent documentation of server.listen() by mgjm · Pull Request #16020 · nodejs/node · GitHub

/ node Public

doc: fix inconsistent documentation of server.listen() - #16020

Closed
mgjm wants to merge 4 commits into
nodejs:masterfrom
mgjm-fork:fix-documentaion-listen
Closed

doc: fix inconsistent documentation of server.listen()#16020
mgjm wants to merge 4 commits into
nodejs:masterfrom
mgjm-fork:fix-documentaion-listen

Conversation

mgjm commented Oct 6, 2017
edited
Loading

Copy link
Copy Markdown
Contributor

First commit:
The net, tls, http and https module have the same
server.listen() method, but have a different documenation.
Changed to a consistent link to the documentation of the net module.

Fixes #11915

Second commit:
The https.createServer() function is above some https.Server
methods. Move server.close() and server.listen() to the correct
position.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

mgjm added 2 commits October 6, 2017 11:50
The `net`, `tls`, `http` and `https` module have the same
`server.listen()` method, but have a different documenation.
Changed to a consistent link to the documentation of the `net` module.
The `https.createServer()` function is above some `https.Server`
methods. Move `server.close()` and `server.listen()` to the correct
position.
nodejs-github-bot added the doc Issues and PRs related to the documentations. label Oct 6, 2017
mscdex added http Issues or PRs related to the http subsystem. https Issues or PRs related to the https subsystem. tls Issues and PRs related to the tls subsystem. labels Oct 6, 2017
Trott added the code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. label Oct 7, 2017

Trott commented Oct 10, 2017

Copy link
Copy Markdown
Member

Ping @nodejs/documentation: Can we get some reviews for this?

Comment thread doc/api/http.md Outdated
*Note*: The `server.listen()` method can be called again if and only if there was an error
during the first `server.listen()` call or `server.close()` has been called.
Otherwise, an `ERR_SERVER_ALREADY_LISTEN` error will be thrown.
Start a server listening for connections. This method is identical to [`server.listen()`][] from [`net.Server`][].

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I wouldn't put this as

This method is identical to [`server.listen()`][] from [`net.Server`][].

because it starts a HTTP server, not a bare TCP/IPC server. IMO a better way to put this would be something like:

Starts the HTTP server listening for connections.
This method has the same signatures as [`server.listen()`][] from [`net.Server`][].

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Actually the two methods are equal net.Server.prototype.listen === http.Server.prototype.listen. So a compromise would be:

Starts the HTTP server listening for connections.
This method is identical to [`server.listen()`][] from [`net.Server`][].

Comment thread doc/api/https.md Outdated
-->
- `callback` {Function}

See [`http.close()`][] for details.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

http.close() is a little bit ambiguous. Maybe

See [`server.close()`][`http.close()`] from the HTTP module for details.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I only moved the description of http.close() to another location. But it would be a nice change to make the description better.

lpinca commented Oct 14, 2017

Copy link
Copy Markdown
Member

@mgjm can you please address @joyeecheung comments?. Also please break lines at 80 chars.

mgjm added 2 commits October 14, 2017 17:12
The different server.listen() methods are all the same function but
result in different servers listening for connections.
This fact is now also documented.
The documentation of `server.close()` in the https module only links
to the documentation in the http module and is a bit ambiguous.
Changed the documentation in the https module to clarify the relation.

mgjm commented Oct 14, 2017

Copy link
Copy Markdown
Contributor Author

Sorry for the delay.
I just made the changes according to my comments and pushed the changes to my branch.
Do i need to create a new pull request or something else?

lpinca commented Oct 14, 2017

Copy link
Copy Markdown
Member

@mgjm no this is perfect.

lpinca commented Oct 14, 2017

Copy link
Copy Markdown
Member

@bengl @sam-github @joyeecheung PTAL.

Comment thread doc/api/http.md
[`net.Server.listen(path)`]: net.html#net_server_listen_path_backlog_callback
[`net.Server.listen(port)`]: net.html#net_server_listen_port_host_backlog_callback
[`net.Server`]: net.html#net_class_net_server
[`server.listen()`]: net.html#net_server_listen

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

All of these should be in the sorted order.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I am not certain if there is a lint rule for things like this but this would be pretty neat!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I would like to address this in another PR and write some automation / linting to check for the order of the documented methods as well as the order of the links

BridgeAR self-assigned this Oct 18, 2017

bengl commented Oct 18, 2017

Copy link
Copy Markdown
Member

still LGTM

BridgeAR pushed a commit that referenced this pull request Oct 19, 2017
The `net`, `tls`, `http` and `https` module have the same
`server.listen()` method, but have a different documenation.
Changed to a consistent link to the documentation of the `net` module.

PR-URL: #16020
Reviewed-By: Bryan English <bryan@bryanenglish.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

Copy link
Copy Markdown
Member

Landed in 278f653

Thanks for the PR, and congratulations on becoming a Node.js Contributor 🎉 !

Copy link
Copy Markdown
Contributor

hey @nodejs/collaborators would someone be willing to backport this to v8.x-staging?

lpinca pushed a commit to lpinca/node that referenced this pull request Oct 24, 2017
The `net`, `tls`, `http` and `https` module have the same
`server.listen()` method, but have a different documenation.
Changed to a consistent link to the documentation of the `net` module.

PR-URL: nodejs#16020
Reviewed-By: Bryan English <bryan@bryanenglish.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
addaleax pushed a commit to ayojs/ayo that referenced this pull request Oct 26, 2017
The `net`, `tls`, `http` and `https` module have the same
`server.listen()` method, but have a different documenation.
Changed to a consistent link to the documentation of the `net` module.

PR-URL: nodejs/node#16020
Reviewed-By: Bryan English <bryan@bryanenglish.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
gibfahn pushed a commit that referenced this pull request Oct 30, 2017
The `net`, `tls`, `http` and `https` module have the same
`server.listen()` method, but have a different documenation.
Changed to a consistent link to the documentation of the `net` module.

PR-URL: #16020
Backport-PR-URL: #16435
Reviewed-By: Bryan English <bryan@bryanenglish.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
gibfahn pushed a commit that referenced this pull request Oct 31, 2017
The `net`, `tls`, `http` and `https` module have the same
`server.listen()` method, but have a different documenation.
Changed to a consistent link to the documentation of the `net` module.

PR-URL: #16020
Backport-PR-URL: #16435
Reviewed-By: Bryan English <bryan@bryanenglish.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
gibfahn mentioned this pull request Oct 31, 2017

Copy link
Copy Markdown
Contributor

Should this be backported to v6.x-staging? If yes please follow the guide and raise a backport PR, if not let me know or add the dont-land-on label.

addaleax pushed a commit to ayojs/ayo that referenced this pull request Dec 7, 2017
The `net`, `tls`, `http` and `https` module have the same
`server.listen()` method, but have a different documenation.
Changed to a consistent link to the documentation of the `net` module.

PR-URL: nodejs/node#16020
Reviewed-By: Bryan English <bryan@bryanenglish.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

Copy link
Copy Markdown
Member

Currently working through some backports & since this appears to have been backported to v8.x already we may want to remove the backport-requested-v8.x label :)

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. doc Issues and PRs related to the documentations. http Issues or PRs related to the http subsystem. https Issues or PRs related to the https subsystem. tls Issues and PRs related to the tls subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document tls.Server#listen(path, callback) and possible other signatures

Back | FazBrowse Home | New Git URL