summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaad Quadri <saad@saadq.com>2019-02-18 18:20:58 -0500
committerRyan Dahl <ry@tinyclouds.org>2019-02-18 18:20:58 -0500
commit97e29e3dd068c938ec5f8346183f8f523dea23c0 (patch)
tree4fd32d018816e095aacdcbb8fef7c6ae1edffea1
parenta1de28dbef5718ddf03ebce5c3c29f31a8631992 (diff)
Fix http server example in homepage (#1801)
This fixes http server example by updating the import path as well as using respond() correctly.
-rw-r--r--website/index.html6
1 files changed, 3 insertions, 3 deletions
diff --git a/website/index.html b/website/index.html
index 349ca36e9..fa05ecf46 100644
--- a/website/index.html
+++ b/website/index.html
@@ -104,12 +104,12 @@ href="https://github.com/denoland/deno_install/blob/master/install.ps1">https://
<p>Or a more complex one:</p>
- <pre><code class="typescript language-typescript">import { serve } from "https://deno.land/x/http/server.ts";
+ <pre><code class="typescript language-typescript">import { serve } from "https://deno.land/x/std/http/server.ts";
const s = serve("0.0.0.0:8000");
async function main() {
- for await (const req of s) {
- req.respond({ body: new TextEncoder().encode("Hello World\n") });
+ for await (const { res } of s) {
+ res.respond({ body: new TextEncoder().encode("Hello World\n") });
}
}