Sesame-Server/Sources/Run/main.swift

16 lines
307 B
Swift
Raw Normal View History

2022-01-23 20:49:06 +01:00
import App
import Vapor
2023-02-17 00:09:51 +01:00
var env = Environment.production //.detect()
2022-01-23 20:49:06 +01:00
try LoggingSystem.bootstrap(from: &env)
let app = Application(env)
defer { app.shutdown() }
2023-02-17 00:09:51 +01:00
private let semaphore = DispatchSemaphore(value: 0)
Task {
try await configure(app)
semaphore.signal()
}
semaphore.wait()
2022-01-23 20:49:06 +01:00
try app.run()