Class StaticAssetHandler

Handler that serves static resources on specific paths. Relative file paths are assumed to be relative to the current working directory. Relative file paths can be preceded by @css:, e.g. @css:foo/bar, in case they need to be relative to the module root. File paths ending in a slash assume the target is a folder and map all of its contents.




expires: number
logger: Logger = ...
mappings: Record<string, string>
pathMatcher: RegExp


  • Checks whether the input can be handled by this class. If it cannot handle the input, rejects with an error explaining why.


    Returns Promise<void>

    A promise resolving if the input can be handled, rejecting with an Error if not.