class StaticFilesService
implements IStaticFiles
Since 0.1.0

Static files service that serves files from a configured root directory.

Constructors

StaticFilesService(options: StaticPluginOptions)

Creates a new StaticFilesService.

Parameters

Plugin options including the filesystem

Methods

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

Serves the static file addressed by the request context.

Delegates to the same handler the plugin mounts on GET/HEAD, so this entry point and the routes cannot diverge.

Usage

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