     /// Optionally sets expiration of the cached pre-flight request. Value is in seconds.
     public let cacheExpiration: Int?
 
-    /// Headers exposed in the response fo pre-flight request.
+    /// Headers exposed in the response of pre-flight request.
     public let exposedHeaders: String?
 
+    /// Instantiate a CORSConfiguration struct that can be used to create a `CORSConfiguration`
+    /// middleware for adding support for CORS in your responses.
+    ///
+    /// - Parameters:
+    ///   - allowedOrigin: Setting that controls which origin values are allowed.
+    ///   - allowedMethods: Methods that are allowed for a CORS request response.
+    ///   - allowedHeaders: Headers that are allowed in a response for CORS request.
+    ///   - allowCredentials: If cookies and other credentials will be sent in the response.
+    ///   - cacheExpiration: Optionally sets expiration of the cached pre-flight request in seconds.
+    ///   - exposedHeaders: Headers exposed in the response of pre-flight request.
     public init(allowedOrigin: AllowOriginSetting,
                 allowedMethods: [Method],
                 allowedHeaders: [String],


        // Cache expiration
        self.cacheExpiration = try cors.extract("cacheExpiration") ?? 600

        // Exposed headers
        self.exposedHeaders = try cors.extract("exposedHeaders")
    }

    /// - Parameter config: The settings config dictionary that should be used to extract settings.
    /// - Throws: Node extraction errors, if extraction fails.
    public init(config: Settings.Config) throws {
        let cors: Node
        do {
            cors = try config.extract("cors") ?? config.extract("CORS")
        } catch {
            throw CORSConfigurationError.configurationFileNotFound
        }

        // Allowed origin
        do {
            let originString: String = try cors.extract("allowedOrigin")
            switch originString {
            case "all", "*": self.allowedOrigin = .all
            case "none", "": self.allowedOrigin = .none
            case "origin", "Origin": self.allowedOrigin = .originBased
            default: self.allowedOrigin = .custom(originString)
            }
        } catch {
            throw CORSConfigurationError.missingRequiredConfigurationKey("allowedOrigin")
        }

        // Get methods
        do {
            let methodArray: [String] = try cors.extract("allowedMethods")
            self.allowedMethods = methodArray.joined(separator: ", ").uppercased()
        } catch {
            throw CORSConfigurationError.missingRequiredConfigurationKey("allowedMethods")
        }

        // Get allowed headers
        do {
            let headersArray: [String] = try cors.extract("allowedHeaders")
            self.allowedHeaders = headersArray.joined(separator: ", ")
        } catch {
            throw CORSConfigurationError.missingRequiredConfigurationKey("allowedHeaders")
        }

        // Allow credentials
        let allowCredentials: Bool? = try cors.extract("allowCredentials")
