Options

public struct Options

Configuration options for StaticFileServer.

  • Initialize an Options instance.

    Declaration

    Swift

    public init(possibleExtensions: [String] = [], serveIndexForDirectory: Bool = true,
                 redirect: Bool = true, cacheOptions: CacheOptions = CacheOptions())

    Parameters

    possibleExtensions

    an array of file extensions to be added to the file name in case the file was not found. The extensions are added in the order they appear in the array, and a new search is performed.

    serveIndexForDirectory

    an indication whether to serve “index.html” file the requested path is a directory.

    redirect

    an indication whether to redirect to trailing “/” when the requested path is a directory.

    cacheOptions

    cache options for StaticFileServer.