Initializer

init(archivePath:redirectRoot:redirectMissingTrailingSlash:)

Create a new middleware that serves files from the DocC archive at archivePath.

Declaration

init(archivePath: URL, redirectRoot: String? = nil, redirectMissingTrailingSlash: Bool = false)

Parameters

archivePath

The path to the DocC archive.

redirectRoot

When non-nil the root (/) will be redirected to the provided path. Defaults to nil.

redirectMissingTrailingSlash

When true paths the require trailing slashes will be redirected to include the trailing slash. Defaults to false.

Discussion

When the redirectMissingTrailingSlash parameter is true the /documentation and /tutorials endpoints will be redirected to /documentation/ and /tutorials/ respectively.