Update vapor

This commit is contained in:
Christoph Hagen
2020-09-20 11:36:35 +02:00
parent b52e4f5740
commit 5672fbf300
7 changed files with 79 additions and 75 deletions

View File

@@ -1,26 +1,9 @@
import App
import Service
import Vapor
import Foundation
// The contents of main are wrapped in a do/catch block because any errors that get raised to the top level will crash Xcode
do {
var config = Config.default()
var env = try Environment.detect()
var services = Services.default()
try App.configure(&config, &env, &services)
let app = try Application(
config: config,
environment: env,
services: services
)
try App.boot(app)
try app.run()
} catch {
print(error)
exit(1)
}
var env = try Environment.detect()
try LoggingSystem.bootstrap(from: &env)
let app = Application(env)
defer { app.shutdown() }
try configure(app)
try app.run()