Deno.ServeOptions

UNSTABLE: New API, yet to be vetted.

interface ServeOptions extends Partial<Deno.ListenOptions> {
onError?: (error: unknown) => Response | Promise<Response>;
onListen?: (params: {
hostname: string;
port: number;
}
) => void
;
signal?: AbortSignal;
}

§Extends

§Properties

§
onError?: (error: unknown) => Response | Promise<Response>
[src]

The handler to invoke when route handlers throw an error.

§
onListen?: (params: {
hostname: string;
port: number;
}
) => void
[src]

The callback which is called when the server started listening

§
signal?: AbortSignal
[src]

An AbortSignal to close the server and all connections.