1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 23:34:47 -05:00

fix: revert http server example on the homepage (#1814)

This commit is contained in:
Dmitry Teplov 2019-02-20 06:53:03 +03:00 committed by Ryan Dahl
parent c4e3728575
commit 36eecad148

View file

@ -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/std/http/server.ts";
<pre><code class="typescript language-typescript">import { serve } from "https://deno.land/x/std@v0.2.10/http/server.ts";
const s = serve("0.0.0.0:8000");
async function main() {
for await (const { res } of s) {
res.respond({ body: new TextEncoder().encode("Hello World\n") });
for await (const req of s) {
req.respond({ body: new TextEncoder().encode("Hello World\n") });
}
}