Options

public struct Options

Configuration options for StaticFileServer.

  • Initialize an Options instance.

    Parameter

    Parameter 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.

    Parameter

    Parameter serveIndexForDirectory: an indication whether to serve index.html file the requested path is a directory.

    Parameter

    Parameter redirect: an indication whether to redirect to trailing / when the requested path is a directory.

    Parameter

    Parameter cacheOptions: cache options for StaticFileServer.

    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.