Skip to main content
interface Deno.ServeOptions
implements Partial<Deno.ListenOptions>
Unstable

Options which can be set when calling Deno.serve.

Properties

optional
signal: AbortSignal

An AbortSignal to close the server and all connections.

optional
reusePort: boolean

Sets SO_REUSEPORT on POSIX systems.

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

The handler to invoke when route handlers throw an error.

optional
onListen: (params: { hostname: string; port: number; }) => void

The callback which is called when the server starts listening.