This repository has been archived on 2021-03-29. You can view files and clone it, but cannot push or open issues or pull requests.
statusboard/Sources/App/configure.swift

18 lines
466 B
Swift
Raw Normal View History

2020-11-11 22:49:55 +00:00
import Vapor
import Leaf
import LeafErrorMiddleware
// configures your application
public func configure(_ app: Application) throws {
// Serve files from /Public
app.middleware.use(FileMiddleware(publicDirectory: app.directory.publicDirectory))
app.middleware.use(LeafErrorMiddleware())
// Configure Leaf
LeafOption.caching = app.environment.isRelease ? .default : .bypass
app.views.use(.leaf)
// Register routes
try routes(app)
}