diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-08-19 14:36:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-19 14:36:01 +0200 |
commit | 5beec3f106b0890cc76150d0e3b3661c576d4c3b (patch) | |
tree | 9692e24bdb5a7e1d1c883b91961cdacff3e6708c /cli/bench/http/deno_flash_send_file.js | |
parent | 1848c7e361f1a3a33487b60ab6fcb61ed1f62273 (diff) |
feat(unstable): change Deno.serve() API (#15498)
- Merge "Deno.serve()" and "Deno.serveTls()" API
- Remove first argument and use "fetch" field options instead
- Update type declarations
- Add more documentation
Diffstat (limited to 'cli/bench/http/deno_flash_send_file.js')
-rw-r--r-- | cli/bench/http/deno_flash_send_file.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cli/bench/http/deno_flash_send_file.js b/cli/bench/http/deno_flash_send_file.js index db2ad7a82..81e8c4991 100644 --- a/cli/bench/http/deno_flash_send_file.js +++ b/cli/bench/http/deno_flash_send_file.js @@ -6,9 +6,9 @@ const { serve } = Deno; const path = new URL("../testdata/128k.bin", import.meta.url).pathname; -function handler() { +function fetch() { const file = Deno.openSync(path); return new Response(file.readable); } -serve(handler, { hostname, port: Number(port) }); +serve({ fetch, hostname, port: Number(port) }); |