From cd21cff29942f24ba7d38287186cce64d0e84e56 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Thu, 18 Aug 2022 17:35:02 +0530 Subject: feat(ext/flash): An optimized http/1.1 server (#15405) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bartek IwaƄczuk Co-authored-by: Ben Noordhuis Co-authored-by: crowlkats Co-authored-by: Ryan Dahl --- cli/bench/http/deno_flash_send_file.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 cli/bench/http/deno_flash_send_file.js (limited to 'cli/bench/http/deno_flash_send_file.js') diff --git a/cli/bench/http/deno_flash_send_file.js b/cli/bench/http/deno_flash_send_file.js new file mode 100644 index 000000000..261f5a207 --- /dev/null +++ b/cli/bench/http/deno_flash_send_file.js @@ -0,0 +1,14 @@ +// Copyright 2018-2022 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; + +const path = new URL("../testdata/128k.bin", import.meta.url).pathname; + +function handler() { + const file = Deno.openSync(path, { read: true }); + return new Response(file.readable); +} + +serve(handler, { hostname, port: Number(port) }); -- cgit v1.2.3