feat: Deprecate 'Deno.serveHttp' API (#21874)

`Deno.serveHttp` is now deprecated. 

Users should migrate to `Deno.serve` API.
This commit is contained in:
Bartek Iwańczuk 2024-01-14 22:17:50 +01:00 committed by GitHub
parent 0d51c1f90e
commit a25055356c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5286,7 +5286,9 @@ declare namespace Deno {
/** The event yielded from an {@linkcode HttpConn} which represents an HTTP
* request from a remote client.
*
* @category HTTP Server */
* @category HTTP Server
* @deprecated Use {@linkcode serve} instead.
*/
export interface RequestEvent {
/** The request from the client in the form of the web platform
* {@linkcode Request}. */
@ -5305,7 +5307,9 @@ declare namespace Deno {
* yields up {@linkcode RequestEvent} events, representing individual
* requests on the HTTP server connection.
*
* @category HTTP Server */
* @category HTTP Server
* @deprecated Use {@linkcode serve} instead.
*/
export interface HttpConn extends AsyncIterable<RequestEvent>, Disposable {
/** The resource ID associated with this connection. Generally users do not
* need to be aware of this identifier. */
@ -5370,6 +5374,7 @@ declare namespace Deno {
* used elsewhere. In such a case, this function will fail.
*
* @category HTTP Server
* @deprecated Use {@linkcode serve} instead.
*/
export function serveHttp(conn: Conn): HttpConn;