summaryrefslogtreecommitdiff
path: root/cli/tools/repl
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2024-04-24 15:45:49 -0400
committerGitHub <noreply@github.com>2024-04-24 19:45:49 +0000
commit2f8825a935bfdf21ca592284556cd86c1552ac8d (patch)
tree68beddeb5547861212be188f126113e6b1afc1df /cli/tools/repl
parentc1bd9503dd0288a3c209ca2724d2a1de9d5d122b (diff)
feat: Add `deno serve` subcommand (#23511)
By default, `deno serve` will assign port 8000 (like `Deno.serve`). Users may choose a different port using `--port`. `deno serve /tmp/file.ts` `server.ts`: ```ts export default { fetch(req) { return new Response("hello world!\n"); }, }; ```
Diffstat (limited to 'cli/tools/repl')
-rw-r--r--cli/tools/repl/mod.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/cli/tools/repl/mod.rs b/cli/tools/repl/mod.rs
index 03b8e512e..d1c1cab71 100644
--- a/cli/tools/repl/mod.rs
+++ b/cli/tools/repl/mod.rs
@@ -15,6 +15,7 @@ use deno_core::serde_json;
use deno_core::unsync::spawn_blocking;
use deno_runtime::permissions::Permissions;
use deno_runtime::permissions::PermissionsContainer;
+use deno_runtime::WorkerExecutionMode;
use rustyline::error::ReadlineError;
mod channel;
@@ -170,6 +171,7 @@ pub async fn run(flags: Flags, repl_flags: ReplFlags) -> Result<i32, AnyError> {
let test_event_sender = worker.sender;
let mut worker = worker_factory
.create_custom_worker(
+ WorkerExecutionMode::Repl,
main_module.clone(),
permissions,
vec![crate::ops::testing::deno_test::init_ops(test_event_sender)],