UNPKG

@universal-middleware/sirv

Version:
23 lines (20 loc) 753 B
import { Stats } from 'node:fs'; import { UniversalMiddleware } from '@universal-middleware/core'; type OnNoMatch = (req: Request) => Response | undefined | Promise<Response | undefined>; type Arrayable<T> = T | T[]; interface ServeOptions { dev?: boolean; etag?: boolean; maxAge?: number | null; immutable?: boolean; single?: string | boolean; ignores?: false | Arrayable<string | RegExp>; extensions?: string[]; dotfiles?: boolean; brotli?: boolean; gzip?: boolean; onNoMatch?: OnNoMatch; setHeaders?: (res: Response, pathname: string, stats: Stats) => void; } declare function serveStatic(dir?: string, opts?: ServeOptions): UniversalMiddleware; export { type ServeOptions, serveStatic as default };