Go to Latest
interface ServeDirOptions
import { type ServeDirOptions } from "https://dotland.deno.dev/std@0.181.0/http/file_server.ts";

Interface for serveDir options.

Properties

optional
fsRoot: string

Serves the files under the given directory root. Defaults to your current directory.

optional
urlRoot: string

Specified that part is stripped from the beginning of the requested pathname.

optional
showDirListing: boolean = false

Enable directory listing.

optional
showDotfiles: boolean = false

Serves dotfiles.

optional
showIndex: boolean

Serves index.html as the index file of the directory.

optional
enableCors: boolean = false

Enable CORS via the "Access-Control-Allow-Origin" header.

optional
quiet: boolean = false

Do not print request level logs. Defaults to false.

optional
etagAlgorithm: DigestAlgorithm = "fnv1a"

The algorithm to use for generating the ETag.

optional
headers: string[] = []

Headers to add to each response