Skip to content

doc: improve server.listen() random port

  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

doc

Description of change

Minor rewording related to making a server listen to a random port, and added how to retrieve which port was randomly chosen by the OS. Although the previous text ".. to have the operating system assign an available port" is correct, I think using the term "random port" is easier to spot and usually what one might be searching for when looking for this type of functionality.

Also changed documented server.listen() signature as it does in fact not require port to be provided (lib/net.js#L1342).

/cc @nodejs/documentation

Merge request reports

Loading