diff options
author | Satya Rohith <me@satyarohith.com> | 2024-05-17 11:08:50 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-17 05:38:50 +0000 |
commit | 20cb0e8863beb0d709adc2f41905ce3f1f465447 (patch) | |
tree | 4a07e3bf67905e14513d8372db84169d493dfc8f /cli/worker.rs | |
parent | 2b560be83f621af5cab1ff09fa0e76c826e6870a (diff) |
feat(serve): support `--port 0` to use an open port (#23846)
Closes https://github.com/denoland/deno/issues/23845
Diffstat (limited to 'cli/worker.rs')
-rw-r--r-- | cli/worker.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/cli/worker.rs b/cli/worker.rs index 151a4ec4f..bfdeb3568 100644 --- a/cli/worker.rs +++ b/cli/worker.rs @@ -1,6 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -use std::num::NonZeroU16; use std::path::Path; use std::path::PathBuf; use std::rc::Rc; @@ -148,7 +147,7 @@ struct SharedWorkerState { disable_deprecated_api_warning: bool, verbose_deprecated_api_warning: bool, code_cache: Option<Arc<dyn code_cache::CodeCache>>, - serve_port: Option<NonZeroU16>, + serve_port: Option<u16>, serve_host: Option<String>, } @@ -418,7 +417,7 @@ impl CliMainWorkerFactory { feature_checker: Arc<FeatureChecker>, options: CliMainWorkerOptions, node_ipc: Option<i64>, - serve_port: Option<NonZeroU16>, + serve_port: Option<u16>, serve_host: Option<String>, enable_future_features: bool, disable_deprecated_api_warning: bool, |