BundleSetupError
FileMiddleware.swift:16struct BundleSetupError
struct BundleSetupError
import Vapor
Vapor is a framework for building server applications, APIs and websites in Swift. It provides a safe, performant and scalable foundation for building large complex backends.
final class FileMiddleware
Serves static files from a public directory.
convenience init(bundle: Bundle, publicDirectory: String = "Public", defaultFile: String? = nil, directoryAction: DirectoryAction = .none, cachePolicy: CachePolicy = .browserDefault) throws
Creates a new FileMiddleware
for a server contained in an Xcode Project.
init(publicDirectory: String, defaultFile: String? = nil, directoryAction: DirectoryAction = .none, advancedETagComparison: Bool = false, cachePolicy: CachePolicy = .browserDefault)
Creates a new FileMiddleware
.
func respond(to request: Request, chainingTo next: any AsyncResponder) async throws -> Response
struct CachePolicy
The browser cache policy files should be served with.
struct DirectoryAction
Possible actions to take when the request doesn’t have a trailing slash but matches a directory
protocol Equatable
A type that can be compared for value equality.
protocol Error : Sendable
A type representing an error value that can be thrown.
protocol Sendable
static let bundleResourceURLIsNil: Self
Cannot generate Bundle Resource URL
static let publicDirectoryIsNotAFolder: Self
Cannot find any actual folder for the given Public Directory
var localizedDescription: String { get }
Retrieve the localized description for this error.
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.