summaryrefslogtreecommitdiff
path: root/http_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'http_test.ts')
-rw-r--r--http_test.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/http_test.ts b/http_test.ts
index 1b16b0f0a..b0007a892 100644
--- a/http_test.ts
+++ b/http_test.ts
@@ -5,10 +5,11 @@ const addr = "0.0.0.0:8000";
const s = serve(addr);
console.log(`listening on http://${addr}/`);
+const body = new TextEncoder().encode("Hello World\n");
+
async function main() {
for await (const req of s) {
- console.log("Req", req);
- req.respond({ body: "Hello World\n" });
+ await req.respond({ status: 200, body });
}
}