Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno/cli/dts/lib.deno.unstable.d.ts>Deno.ServeOptions

A modern runtime for JavaScript and TypeScript.
Go to Latest
interface Deno.ServeOptions
implements Partial<Deno.ListenOptions>
import { type Deno } from "https://deno.land/x/deno@v1.28.0/cli/dts/lib.deno.unstable.d.ts";
const { ServeOptions } = Deno;

UNSTABLE: New API, yet to be vetted.

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.