std/http/server.ts

Deno standard library
Go to Latest
interface ServerInit
implements Partial<Deno.ListenOptions>
import { type ServerInit } from "https://deno.land/std@0.147.0/http/server.ts?s=ServerInit";

Options for running an HTTP server.

Properties

handler: Handler[src]

The handler to invoke for individual HTTP requests.

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

The handler to invoke when route handlers throw an error.

The default error handler logs and returns the error in JSON format.