1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 15:24:46 -05:00

docs(runtime): fix fetch API usage of HTTP server (#10777)

This commit is contained in:
Takeshi Kurosawa 2021-05-28 15:31:18 +09:00 committed by GitHub
parent 59237d195f
commit 76e2edc7e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -204,9 +204,11 @@ object. Responding with a basic "hello world" would look like this:
async function handle(conn: Deno.Conn) {
const httpConn = Deno.serveHttp(conn);
for await (const requestEvent of httpConn) {
await requestEvent.respondWith(new Response("hello world"), {
status: 200,
});
await requestEvent.respondWith(
new Response("hello world", {
status: 200,
}),
);
}
}
```