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

x/ayonli_jsext/http.ts>ServeStaticOptions

A JavaScript extension package for building strong and modern applications.
Latest
interface ServeStaticOptions
Re-export
import { type ServeStaticOptions } from "https://deno.land/x/ayonli_jsext@v0.9.72/http.ts";

Options for serving static files, used by serveStatic.

Properties

optional
fsDir: string

The file system directory to serve files from. If not set, the current working directory will be used. This option is not available in Cloudflare Workers, set kv instead.

optional
kv: KVNamespace

A KV namespace in Cloudflare Workers where the static files are stored. This option is only needed in Cloudflare Workers, usually obtained from the __STATIC_CONTENT binding.

optional
urlPrefix: string

The prefix that will be stripped from the URL pathname.

optional
listDir: boolean

Whether to list the directory entries when the URL pathname is a directory. If not set, a 403 Forbidden response will be returned.

optional
maxAge: number

The maximum age in seconds for the "Cache-Control" header.

optional
headers: HeadersInit

Extra headers to be sent with the response.