diff options
author | Satya Rohith <me@satyarohith.com> | 2021-04-20 19:56:31 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-20 16:26:31 +0200 |
commit | 15ffdd2624108f99960fc2da86e4f751e32bfd16 (patch) | |
tree | 2817ea0ad87a2fc3148380e4ee298e1fd1cc9cc3 /cli/tests/workers/http_worker.js | |
parent | 9e6cd91014ac4a0d34556b0d09cbe25e4e0930c6 (diff) |
fix(runtime): include HTTP op in WebWorker (#10207)
Diffstat (limited to 'cli/tests/workers/http_worker.js')
-rw-r--r-- | cli/tests/workers/http_worker.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cli/tests/workers/http_worker.js b/cli/tests/workers/http_worker.js new file mode 100644 index 000000000..ee2e5397e --- /dev/null +++ b/cli/tests/workers/http_worker.js @@ -0,0 +1,10 @@ +// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. +const listener = Deno.listen({ hostname: "127.0.0.1", port: 4500 }); +for await (const conn of listener) { + (async () => { + const requests = Deno.serveHttp(conn); + for await (const { respondWith } of requests) { + respondWith(new Response("Hello world")); + } + })(); +} |