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
2020-11-11 18:11:12 -08:00

19 lines
506 B
Swift

import Vapor
import Leaf
import LeafErrorMiddleware
// configures your application
public func configure(_ app: Application) throws {
app.middleware.use(LeafErrorMiddleware())
// Serve files from /Public
app.middleware.use(FileMiddleware(publicDirectory: app.directory.publicDirectory))
// Configure Leaf
LeafOption.caching = app.environment.isRelease ? .default : .bypass
LeafRenderer.Option.timeout = 200.0
app.views.use(.leaf)
// Register routes
try routes(app)
}