import type { Plugin } from './app'; /** Options for {@link serveStatic}. */ export interface StaticOptions { /** Directory whose files are served, resolved to an absolute path from the process's working directory. */ dir: string; /** URL prefix to mount under (default `"/"`). Stripped before file lookup. */ prefix?: string; /** File served for a directory request (default `"index.html"`; `""` disables). */ index?: string; /** `Cache-Control` header value set on every served file; omit to send none. */ cacheControl?: string; } /** * Plugin: serve files from a directory before routing. A `GET`/`HEAD` under * `prefix` maps to a file in `dir` (`Content-Type` inferred from the extension); * a directory request serves `index`. A missing file falls through to the * router (so it 404s like any other unmatched route), and a path that escapes * `dir` (via `..`) is refused with `403`. Registered as a pre-routing hook, so * it never shadows a matched controller route beyond its `prefix`. * * ```ts * const app = await createApp({ plugins: [serveStatic({ dir: './public' })] }) * ``` * * @param options - the source `dir`, URL `prefix`, `index` file, and `cacheControl` * @returns a plugin that serves matching files as a pre-routing hook */ export declare function serveStatic(options: StaticOptions): Plugin; //# sourceMappingURL=static.d.ts.map