Server
Server.swift:4protocol Server : SendableBrowse conforming typesprotocol Server : Sendableimport VaporVapor is a framework for building server applications, APIs and websites in Swift. It provides a safe, performant and scalable foundation for building large complex backends.
protocol Sendablevar onShutdown: EventLoopFuture<Void> { get }func shutdown() Shut the server down.
func shutdown() async Shut the server down.
func start(address: BindAddress?) throws Start the server with the specified address.
func start(address: BindAddress?) async throws Start the server with the specified address.
func start(hostname: String?, port: Int?) throws Start the server with the specified hostname and port, if provided. If left blank, the server will be started with its default configuration.
func start() throws Start the server with its default configuration, listening over a regular TCP socket.
func shutdown() async A default implementation for those servers that haven’t migrated yet
func start(address: BindAddress?) throws A default implementation that throws ServerStartError.unsupportedAddress for .unixDomainSocket(path:) if start(address:) is not implemented by the conforming type, or calls the deprecated .start(hostname:port:) method for other cases.
func start(address: BindAddress?) async throws A default implementation for those servers that haven’t migrated yet
func start(hostname: String?, port: Int?) throws Start the server with the specified hostname and port, if provided. If left blank, the server will be started with its default configuration.