ServeDirOptions

import { ServeDirOptions } from "jsr:@ende/http";

interface

interface ServeDirOptions

Interface for serveDir options.

Properties

fsRoot

fsRoot?: string

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

Default: "."

urlRoot

urlRoot?: string

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

showDirListing

showDirListing?: boolean

Enable directory listing.

Default: false

showDotfiles

showDotfiles?: boolean

Serves dotfiles.

Default: false

showIndex

showIndex?: boolean

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

Default: true

enableCors

enableCors?: boolean

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

Default: false

quiet

quiet?: boolean

Do not print request level logs.

Default: false

etagAlgorithm

etagAlgorithm?: AlgorithmIdentifier

The algorithm to use for generating the ETag.

Default: "SHA-256"

headers

headers?: string[]

Headers to add to each response

Default: []

Source