Schafkopf-Server/Sources/App/configure.swift
2021-12-01 12:45:42 +01:00

16 lines
435 B
Swift

import Vapor
var database: Database!
// configures your application
public func configure(_ app: Application) throws {
// serve files from /Public folder
app.middleware.use(FileMiddleware(publicDirectory: app.directory.publicDirectory))
let storageFolder = URL(fileURLWithPath: app.directory.resourcesDirectory)
database = try Database(storageFolder: storageFolder)
// register routes
try routes(app)
}