diff options
author | Kevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com> | 2020-01-17 15:44:35 -0800 |
---|---|---|
committer | Ry Dahl <ry@tinyclouds.org> | 2020-01-17 18:44:35 -0500 |
commit | fc077cd315f3d2ea508f2aac39bc65d4ac6a5747 (patch) | |
tree | 6a37b08aee4dbd425ba6cdf58b6604e99c389b24 /std/http/README.md | |
parent | 5fa056e53be6d17ab746629ea0eaa89fe817141b (diff) |
std/http: allow response body to be string (#3705)
Diffstat (limited to 'std/http/README.md')
-rw-r--r-- | std/http/README.md | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/std/http/README.md b/std/http/README.md index 459c8e286..993b46cb8 100644 --- a/std/http/README.md +++ b/std/http/README.md @@ -2,11 +2,10 @@ ```typescript import { serve } from "https://deno.land/std/http/server.ts"; -const body = new TextEncoder().encode("Hello World\n"); const s = serve({ port: 8000 }); console.log("http://localhost:8000/"); for await (const req of s) { - req.respond({ body }); + req.respond({ body: "Hello World\n" }); } ``` |