summaryrefslogtreecommitdiff
path: root/cli/bench/http/deno_http_serve.js
diff options
context:
space:
mode:
Diffstat (limited to 'cli/bench/http/deno_http_serve.js')
-rw-r--r--cli/bench/http/deno_http_serve.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/cli/bench/http/deno_http_serve.js b/cli/bench/http/deno_http_serve.js
new file mode 100644
index 000000000..a0db62630
--- /dev/null
+++ b/cli/bench/http/deno_http_serve.js
@@ -0,0 +1,11 @@
+// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
+
+const addr = Deno.args[0] ?? "127.0.0.1:4500";
+const [hostname, port] = addr.split(":");
+const { serve } = Deno;
+
+function handler() {
+ return new Response("Hello World");
+}
+
+serve(handler, { hostname, port, reusePort: true });