interface IStaticFiles
Since 0.1.0

Static files service interface.

Methods

Since 0.1.0
serve(ctx: IRequestContext): Promise<HandlerResult>

Serves the static file addressed by the request context, applying the same conditional-request, Range, and encoding negotiation the mounted routes use — this and the route handler are one implementation, so both honour the plugin's configuration identically.

Answers 404 rather than throwing when the path resolves to nothing, and when the runtime provides no file system (edge platforms), since a missing asset is a not-found and not an error.

Usage

import { type IStaticFiles } from "static-plugin/src/index.ts";