StaticRoute.directory constructor
StaticRoute.directory(
- Directory root, {
- CacheBustingConfig? cacheBustingConfig,
- CacheControlFactory cacheControlFactory = _defaultFactory,
- String? host,
Use StaticRoute.directory to serve everything below a given root.
Use cacheControlFactory to customize what CacheControlHeader to
return for a given asset. Default is to leave caching behavior to client
side heuristics.
The host parameter restricts this route to a specific virtual host
(defaults to null, matching any host).
Implementation
factory StaticRoute.directory(
Directory root, {
CacheBustingConfig? cacheBustingConfig,
CacheControlFactory cacheControlFactory = _defaultFactory,
String? host,
}) {
return StaticRoute._(
StaticHandler.directory(
root,
cacheBustingConfig: cacheBustingConfig,
cacheControl: cacheControlFactory,
).asHandler,
tailMatch: true,
host: host,
);
}