import { type ServeAssetOptions } from "https://deno.land/x/cav@0.0.8/http.ts";
Options controlling how assets are found and served.
Properties
Sets the current working directory when looking for assets. If a file://
path is provided, the parent folder of the path is used. This is useful if
you want to serve assets relative to the current file using
import.meta.url
. Default: "."
Path of the file to serve relative to the dir (which is relative to the
cwd). The full path of the file on disk can be conceptualized as
denoPath.join(cwd, dir, path)
. This option is required, and should
typically be equal to the "path" property on the ResolverArg of an Rpc's
Resolver function or on the OnErrorArg inside an error handler.
When a requested path resolves to a directory and one of these files is
found inside that directory, that file will be served instead of a 404
error. Default: ["index.html"]
When a requested file isn't found, each of these extensions will be
appended to the request path and checked for existence. If the request path
plus one of these extensions is found, that file will be served instead of
a 404 error. Default: ["html"]
Path to use when the provided path results in a 404 error. Use this to
serve a 404 page. If this isn't specified, 404 errors will bubble. Default:
undefined
Once a request's on-disk file path is calculated, the file path will be
passed through each of these provided bundlers. If a bundler returns a
Response, that Response will be served instead of the on-disk file and the
bundling process is halted. Bundlers are responsible for their own caching
techniques. If no array is specified, files are served as-is from disk.
Default: undefined