public final class FileMiddleware: Middleware
Serves static files from a public directory.
FileMiddleware will default to
DirectoryConfig's working directory with
Middlewareis placed between the server and your router. It is capable of mutating both incoming requests and outgoing responses.
Middlewarecan choose to pass requests on to the next
Middlewarein a chain, or they can short circuit and return a custom
public init(publicDirectory: String, defaultFile: String? = nil)
Creates a new
The public directory to serve files from.
The name of the default file to look for and serve if a request hits any public directory. Starting with