         for option in options {
             switch option {
             case .possibleExtensions(let value):
-                possibleExtensions = value
+                configuration.possibleExtensions = value
             case .serveIndexForDir(let value):
-                serveIndexForDirectory = value
+                configuration.serveIndexForDirectory = value
             case .addLastModifiedHeader(let value):
-                addLastModifiedHeader = value
+                configuration.addLastModifiedHeader = value
             case .maxAgeCacheControlHeader(let value):
-                maxAgeCacheControlHeader = value
+                configuration.maxAgeCacheControlHeader = value
             case .redirect(let value):
-                redirect = value
+                configuration.redirect = value
             case .customResponseHeadersSetter(let value):
                 customResponseHeadersSetter = value
             case .generateETag (let value):
-                generateETag = value
+                configuration.generateETag = value
             }
         }
     }

    private func serveExistingFile(_ filePath: String, requestPath: String, isDirectory: Bool,
                                   response: RouterResponse) {
        if isDirectory {
            if redirect {
                do {
                    try response.redirect(requestPath + "/")
                } catch {

// MARK: StaticFileServer

public class StaticFileServer: RouterMiddleware {
    private class Configuration {
        //
        // If a file is not found, the given extensions will be added to the file name and searched for. The first that exists will be served. Example: ['html', 'htm'].
        //
        private var possibleExtensions = [String]()

        //
        // Serve "index.html" files in response to a request on a directory.  Defaults to true.
        //
        private var serveIndexForDirectory = true

        //
        // Uses the file system's last modified value.  Defaults to true.
        //
        private var addLastModifiedHeader = true

        //
        // Value of max-age in Cache-Control header.  Defaults to 0.
        //
        private var maxAgeCacheControlHeader = 0

        //
        // Redirect to trailing "/" when the pathname is a dir. Defaults to true.
        //
        private var redirect = true

        //
        // Generate ETag. Defaults to true.
        //
        private var generateETag = true
    }

    //
    // configuration
    //
    private let configuration = Configuration()


    //
    // A setter for custom response headers.
    //
    private var customResponseHeadersSetter: ResponseHeadersSetter?

    private var path: String

