diff options
| author | Ryan Dahl <ry@tinyclouds.org> | 2019-05-20 09:17:26 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-05-20 09:17:26 -0400 |
| commit | a295bb0d4255993103b6afe9ffdd2bd4e4c65c95 (patch) | |
| tree | 48d491488e8ac12e2f666ea360962a494e819884 /http/http_bench.ts | |
| parent | 227d92e046220de30195432ed5235ccb19c91fc6 (diff) | |
Clean up HTTP async iterator code (denoland/deno_std#411)
Original: https://github.com/denoland/deno_std/commit/68faf32f721d2a95c7b1c75661713c8118c077c7
Diffstat (limited to 'http/http_bench.ts')
| -rw-r--r-- | http/http_bench.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/http/http_bench.ts b/http/http_bench.ts index 6d72d4be6..06043f9e4 100644 --- a/http/http_bench.ts +++ b/http/http_bench.ts @@ -3,13 +3,12 @@ import { serve } from "./server.ts"; const addr = Deno.args[1] || "127.0.0.1:4500"; const server = serve(addr); - const body = new TextEncoder().encode("Hello World"); async function main(): Promise<void> { console.log(`http://${addr}/`); - for await (const request of server) { - request.respond({ status: 200, body }); + for await (const req of server) { + req.respond({ body }); } } |
