跳转到内容
简体中文

StaticFilesOptionsType

此内容尚不支持你的语言。

StaticFilesOptionsType = object

Defined in: src/http/static/StaticFilesOptions.ts:9

Plain settings shape for the static-file directives.

readonly optional browse?: boolean

Defined in: src/http/static/StaticFilesOptions.ts:13

Render an HTML listing when a directory has no usable index. Default false.


readonly optional cacheControl?: string

Defined in: src/http/static/StaticFilesOptions.ts:15

Cache-Control header value. Default: header omitted.


readonly optional contentType?: string

Defined in: src/http/static/StaticFilesOptions.ts:29

getFromFile only: force this exact content-type.


readonly optional contentTypes?: Readonly<Record<string, string>>

Defined in: src/http/static/StaticFilesOptions.ts:27

Per-extension content-type overrides (ext → full content-type).


readonly optional dotfiles?: "deny" | "allow"

Defined in: src/http/static/StaticFilesOptions.ts:23

Dotfile policy. Default 'deny' (404 + hidden from listings).


readonly optional etag?: boolean

Defined in: src/http/static/StaticFilesOptions.ts:17

Emit a weak ETag (size + mtime) and honour If-None-Match. Default true.


readonly optional indexFiles?: readonly string[]

Defined in: src/http/static/StaticFilesOptions.ts:11

Index files tried for a directory request. Default ['index.html']; [] disables.


readonly optional lastModified?: boolean

Defined in: src/http/static/StaticFilesOptions.ts:19

Emit Last-Modified and honour If-Modified-Since. Default true.


readonly optional maxFileSize?: number

Defined in: src/http/static/StaticFilesOptions.ts:31

Max file size buffered into memory. Default 50 MiB; larger → 413.


readonly optional ranges?: boolean

Defined in: src/http/static/StaticFilesOptions.ts:21

Honour a single Range request (206 / 416). Default true.


readonly optional symlinks?: "within-root" | "follow"

Defined in: src/http/static/StaticFilesOptions.ts:25

Symlink policy. Default 'within-root' (a link escaping the root → 404).