Skip to content

serveStaticAsset

function serveStaticAsset(uiDir, path): Promise<Response | null>;

Defined in: src/server/static-assets.ts:51

Try to serve path (base-path-stripped, leading /) as a static file from uiDir. Returns a Response, or null if the file does not exist or the path escapes uiDir. Files under assets/ (content-hashed by the bundler) are cached for a year; everything else is no-cache.

Parameter Type
uiDir string
path string

Promise<Response | null>