entrypoint.swift 454 B

123456789101112131415161718192021
  1. import Vapor
  2. import Logging
  3. @main
  4. enum Entrypoint {
  5. static func main() async throws {
  6. var env = try Environment.detect()
  7. try LoggingSystem.bootstrap(from: &env)
  8. let app = Application(env)
  9. defer { app.shutdown() }
  10. do {
  11. try await configure(app)
  12. } catch {
  13. app.logger.report(error: error)
  14. throw error
  15. }
  16. try await app.execute()
  17. }
  18. }