Skip to content

ServeOptions

ServeOptions = object

Defined in: packages/storage/src/types.ts:201

Options for serving a file directly from R2 as an HTTP response.

The resulting Response streams the file body and includes R2 HTTP metadata (content-type, etag, etc.) plus any additional headers you specify.

env: Record<string, unknown>

Defined in: packages/storage/src/types.ts:203

Workers environment bindings (must include the target R2 bucket).


optional headers: Record<string, string>

Defined in: packages/storage/src/types.ts:205

Additional response headers to include (e.g. Cache-Control).