Class StaticAssetHandler

Handler that serves static resources on specific paths. Relative file paths are assumed to be relative to cwd. Relative file paths can be preceded by @css:, e.g. @css:foo/bar, in case they need to be relative to the module root.

Hierarchy

Constructors

Properties

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

Methods

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

    Parameters

    Returns Promise<void>

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