method StaticFilesService.prototype.serve
Since 0.1.0
StaticFilesService.prototype.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.

Parameters

ctx: IRequestContext

The request context

Return Type

Promise<HandlerResult>

The handler result for the resolved file

Usage

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