mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 10:59:13 +00:00
feat(serve): support --port 0
to use an open port (#23846)
Closes https://github.com/denoland/deno/issues/23845
This commit is contained in:
parent
2b560be83f
commit
20cb0e8863
9 changed files with 96 additions and 16 deletions
|
@ -62,7 +62,6 @@ use std::env;
|
|||
use std::io::BufReader;
|
||||
use std::io::Cursor;
|
||||
use std::net::SocketAddr;
|
||||
use std::num::NonZeroU16;
|
||||
use std::num::NonZeroUsize;
|
||||
use std::path::Path;
|
||||
use std::path::PathBuf;
|
||||
|
@ -1036,7 +1035,7 @@ impl CliOptions {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn serve_port(&self) -> Option<NonZeroU16> {
|
||||
pub fn serve_port(&self) -> Option<u16> {
|
||||
if let DenoSubcommand::Serve(flags) = self.sub_command() {
|
||||
Some(flags.port)
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue