Vapor

From Coder Merlin
Revision as of 23:05, 3 February 2021 by Mukul-agarwal (talk | contribs) (Use Vapor-specific Environment Variables)
Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder

References[edit]

Fluent[edit]

Configuration[edit]

In the path: ./Sources/App/configure.swift:

// Set local port
guard let portString = Environment.get("VAPOR_LOCAL_PORT") else {
    fatalError("Failed to determine VAPOR LOCAL PORT from environment")
}
guard let port = Int(portString) else {
    fatalError("Malformed VAPOR LOCAL PORT: \(portString)")
}
app.http.server.configuration.port = port

// Set local host
guard let hostname = Environment.get("VAPOR_LOCAL_HOST") else {
    fatalError("Failed to determine VAPOR LOCAL HOST from environment")
}
app.http.server.configuration.hostname = hostname