Resolve the HTTP listen port from CLI arguments and environment.
CLI arguments to inspect for --port.
--port
Environment object to read PORT from.
PORT
The validated TCP port.
PortUsageError when the selected port is not in the user-space TCP port range.
const port = getPort(["--port", "3001"], process.env); Copy
const port = getPort(["--port", "3001"], process.env);
Resolve the HTTP listen port from CLI arguments and environment.