summaryrefslogtreecommitdiff
path: root/cli/tests/workers/http_worker.js
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/workers/http_worker.js')
-rw-r--r--cli/tests/workers/http_worker.js10
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"));
+ }
+ })();
+}