'created CapCollectorServer from template https://github.com/twostraws/vapor-clean'
This commit is contained in:
26
Sources/Run/main.swift
Executable file
26
Sources/Run/main.swift
Executable file
@ -0,0 +1,26 @@
|
||||
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)
|
||||
}
|
Reference in New Issue
Block a user