Documentation Language: Swift

Initializer

init(rootDirectory:)

Creates a new static file handler.

init(rootDirectory: URL)

Parameters

rootDirectory

The directory containing files to serve. This should be an absolute path.

Discussion

The root directory is standardised to ensure consistent path resolution.

Example

let handler = StaticFileHandler(
    rootDirectory: URL(fileURLWithPath: "/var/www/docs")
)