1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-26 16:09:27 -05:00

docs: fix native http jsdoc examples (#12207)

This commit is contained in:
Leo K 2021-09-24 12:14:12 +02:00 committed by GitHub
parent faefe2300d
commit 703ca905fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2408,8 +2408,8 @@ declare namespace Deno {
* Services HTTP requests given a TCP or TLS socket.
*
* ```ts
* const conn = await Deno.connect({ port: 80, hostname: "127.0.0.1" });
* const httpConn = Deno.serveHttp(conn);
* const conn = await Deno.listen({ port: 80 });
* const httpConn = Deno.serveHttp(await conn.accept());
* const e = await httpConn.nextRequest();
* if (e) {
* e.respondWith(new Response("Hello World"));
@ -2452,8 +2452,8 @@ declare namespace Deno {
* upgrade to be successful.
*
* ```ts
* const conn = await Deno.connect({ port: 80, hostname: "127.0.0.1" });
* const httpConn = Deno.serveHttp(conn);
* const conn = await Deno.listen({ port: 80 });
* const httpConn = Deno.serveHttp(await conn.accept());
* const e = await httpConn.nextRequest();
* if (e) {
* const { socket, response } = Deno.upgradeWebSocket(e.request);