diff options
author | Leo K <crowlkats@toaxl.com> | 2021-09-24 12:14:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-24 19:14:12 +0900 |
commit | 703ca905fd2ddd1860d704bf43aa66679a47a1e5 (patch) | |
tree | 394e277be0d1a354689ed2025557c2d99ed65e7b /cli/dts/lib.deno.ns.d.ts | |
parent | faefe2300de4e6a9d1422db54e62d21f21cfd762 (diff) |
docs: fix native http jsdoc examples (#12207)
Diffstat (limited to 'cli/dts/lib.deno.ns.d.ts')
-rw-r--r-- | cli/dts/lib.deno.ns.d.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts index 054f3b385..4bd0b1fdc 100644 --- a/cli/dts/lib.deno.ns.d.ts +++ b/cli/dts/lib.deno.ns.d.ts @@ -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); |