Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
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.1/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.