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/testdata | |
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/testdata')
-rw-r--r-- | cli/bench/testdata/deno_upgrade_http.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cli/bench/testdata/deno_upgrade_http.js b/cli/bench/testdata/deno_upgrade_http.js index 638761cf6..e3252ffd1 100644 --- a/cli/bench/testdata/deno_upgrade_http.js +++ b/cli/bench/testdata/deno_upgrade_http.js @@ -1,13 +1,14 @@ const { serve, upgradeHttp } = Deno; const u8 = Deno.core.encode("HTTP/1.1 101 Switching Protocols\r\n\r\n"); -async function handler(req) { +async function fetch(req) { const [conn, _firstPacket] = upgradeHttp(req); await conn.write(u8); await conn.close(); } -serve(handler, { +serve({ + fetch, hostname: "127.0.0.1", port: 9000, }); |