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:
parent
59237d195f
commit
76e2edc7e1
1 changed files with 5 additions and 3 deletions
|
@ -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,
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue