ServeDirOptions
import { ServeDirOptions } from "jsr:@ende/http";interface
interface ServeDirOptionsInterface for serveDir options.
Properties
fsRoot
fsRoot?: stringServes the files under the given directory root. Defaults to your current directory.
Default: "."
urlRoot
urlRoot?: stringSpecified that part is stripped from the beginning of the requested pathname.
showDirListing
showDirListing?: booleanEnable directory listing.
Default: false
showDotfiles
showDotfiles?: booleanServes dotfiles.
Default: false
showIndex
showIndex?: booleanServes index.html as the index file of the directory.
Default: true
enableCors
enableCors?: booleanEnable CORS via the
Access-Control-Allow-Origin
header.
Default: false
quiet
quiet?: booleanDo not print request level logs.
Default: false
etagAlgorithm
etagAlgorithm?: AlgorithmIdentifierThe algorithm to use for generating the ETag.
Default: "SHA-256"
headers
headers?: string[]Headers to add to each response
Default: []