diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2021-04-09 11:54:27 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-09 11:54:27 -0400 |
commit | c6e7a243d524417fe77c4799a2bcc1b3db1bf01a (patch) | |
tree | 7a0a88bf36c6f4cdc8ddfe4beb7e3c917b8a8352 /cli/dts | |
parent | cd0560210aa0ac9dc9772cdddcb1c5a59cef1815 (diff) |
API change: Deno.startHttp -> Deno.serveHttp (#10087)
Diffstat (limited to 'cli/dts')
-rw-r--r-- | cli/dts/lib.deno.unstable.d.ts | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/cli/dts/lib.deno.unstable.d.ts b/cli/dts/lib.deno.unstable.d.ts index 9dbe6817f..91e6825b0 100644 --- a/cli/dts/lib.deno.unstable.d.ts +++ b/cli/dts/lib.deno.unstable.d.ts @@ -1211,18 +1211,20 @@ declare namespace Deno { /** **UNSTABLE**: new API, yet to be vetted. * - * Parse HTTP requests from the given connection + * Services HTTP requests given a TCP or TLS socket. * * ```ts - * const httpConn = await Deno.startHttp(conn); - * const { request, respondWith } = await httpConn.next(); - * respondWith(new Response("Hello World")); + * const httpConn = Deno.serveHttp(conn); + * const e = await httpConn.nextRequest(); + * if (e) { + * e.respondWith(new Response("Hello World")); + * } * ``` * - * If `httpConn.next()` encounters an error or returns `done == true` then - * the underlying HttpConn resource is closed automatically. + * If `httpConn.nextRequest()` encounters an error or returns `null` + * then the underlying HttpConn resource is closed automatically. */ - export function startHttp(conn: Conn): HttpConn; + export function serveHttp(conn: Conn): HttpConn; } declare function fetch( |