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

x/fresh/server.ts>FreshConfig

The next-gen web framework.
Extremely Popular
Go to Latest
interface FreshConfig
Re-export
import { type FreshConfig } from "https://deno.land/x/fresh@1.5.1/server.ts";

Properties

optional
build: { outDir?: string; target?: string | string[]; }
optional
render: RenderFunction
optional
plugins: Plugin[]
optional
staticDir: string
optional
router: RouterOptions
optional
server: Partial<Deno.ServeTlsOptions>
optional
deprecated
cert: string

Server private key in PEM format

optional
deprecated
key: string

Cert chain in PEM format

optional
deprecated
port: number = 8000

The port to listen on.

optional
deprecated
hostname: string = "0.0.0.0"

A literal IP address or host name that can be resolved to an IP address.

Note about 0.0.0.0 While listening 0.0.0.0 works on all platforms, the browsers on Windows don't work with the address 0.0.0.0. You should show the message like server running on localhost:8080 instead of server running on 0.0.0.0:8080 if your program supports Windows.

optional
deprecated
signal: AbortSignal

An AbortSignal to close the server and all connections.

optional
deprecated
reusePort: boolean

Sets SO_REUSEPORT on POSIX systems.

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

The handler to invoke when route handlers throw an error.

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

The callback which is called when the server starts listening.