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

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

A modern runtime for JavaScript and TypeScript.
Latest
interface Deno.ServeOptions
import { type Deno } from "https://deno.land/x/deno@v2.0.4/cli/tsc/dts/lib.deno.ns.d.ts";
const { ServeOptions } = Deno;

Options which can be set when calling Deno.serve.

Type Parameters

optional
Addr extends Deno.Addr = Deno.Addr

Properties

optional
signal: AbortSignal

An AbortSignal to close the server and all connections.

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

The handler to invoke when route handlers throw an error.

optional
onListen: (localAddr: Addr) => void

The callback which is called when the server starts listening.