ServeDirOptions

import { ServeDirOptions } from "jsr:@ende/http/unstable-file-server";

interface ยท experimental

interface ServeDirOptions extends StableServeDirOptions

Interface for serveDir options.

Properties

cleanUrls

cleanUrls?: boolean

Also serves .html files without the need for specifying the extension. For example foo.html could be accessed through both /foo and /foo.html.

Default: false

dotfiles

dotfiles?: "allow" | "deny" | "ignore"

How to treat dotfiles (files and directories whose name starts with a dot):

  • "ignore": respond with 404 Not Found, as if the file does not exist, and hide dotfiles from directory listings.
  • "deny": respond with 403 Forbidden and hide dotfiles from directory listings.
  • "allow": no special treatment; serve dotfiles and show them in directory listings.

Takes precedence over ServeDirOptions.showDotfiles when both are specified.

Default: "ignore"

Source