Ende.ServeOptions

interface

interface Ende.ServeOptions<Addr extends Ende.Addr = Ende.Addr>

Options which can be set when calling Ende.serve.

Properties

signal

signal?: AbortSignal

An AbortSignal to close the server and all connections.

onError

onError?: (error: unknown) => Response | Promise<Response>

The handler to invoke when route handlers throw an error.

onListen

onListen?: (localAddr: Addr) => void

The callback which is called when the server starts listening.

automaticCompression

automaticCompression?: boolean

Whether to automatically compress response bodies when the client accepts a supported encoding and the response is compressible.

Default: false