summaryrefslogtreecommitdiff
path: root/cli/bench/http/bun_http_send_file.js
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2022-08-18 17:35:02 +0530
committerGitHub <noreply@github.com>2022-08-18 17:35:02 +0530
commitcd21cff29942f24ba7d38287186cce64d0e84e56 (patch)
treee663eff884526ee762ae9141a3cf5a0f6967a84e /cli/bench/http/bun_http_send_file.js
parent0b0843e4a54d7c1ddf293ac1ccee2479b69a5ba9 (diff)
feat(ext/flash): An optimized http/1.1 server (#15405)
Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com> Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl> Co-authored-by: crowlkats <crowlkats@toaxl.com> Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
Diffstat (limited to 'cli/bench/http/bun_http_send_file.js')
-rw-r--r--cli/bench/http/bun_http_send_file.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/cli/bench/http/bun_http_send_file.js b/cli/bench/http/bun_http_send_file.js
new file mode 100644
index 000000000..615c35d31
--- /dev/null
+++ b/cli/bench/http/bun_http_send_file.js
@@ -0,0 +1,12 @@
+// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
+const port = Bun.argv[2] || "4545";
+
+const path = new URL("../testdata/128k.bin", import.meta.url).pathname;
+
+Bun.serve({
+ fetch(_req) {
+ const file = Bun.file(path);
+ return new Response(file);
+ },
+ port: Number(port),
+});