import { a as RemoteAssetsStore } from "../remote-assets-eBvSKZMS.mjs"; import { EventHandler, H3 } from "h3"; import { IncomingMessage, ServerResponse } from "node:http"; //#region src/utils/serve-static.d.ts /** * What the static-serving engine accepts: a local directory, or a resolved * {@link RemoteAssetsStore} back-proxy (from `devframe/utils/remote-assets`). */ export type ServableAssets = string | RemoteAssetsStore; export interface ServeStaticOptions { /** Default: `['index.html']`. */ indexNames?: string[]; /** SPA fallback to `indexNames[0]` on miss. Default: `true`. */ single?: boolean; } /** * h3 event handler that serves files from `source` with SPA fallback: a * local directory, or a {@link RemoteAssetsStore} whose files stream through * the CDN back-proxy into the local cache. * * Drop-in replacement for `fromNodeMiddleware(sirv(dir, { dev: true, single: true }))` * when the surrounding server is an h3 app: no `Cache-Control` beyond * `no-store`, `Content-Type` resolved via `mrmime`, and a miss with no * file extension falls back to `