Vapor Documentation Beta

Protocol Server

public protocol Server
%3 Server Server HTTPServer HTTPServer HTTPServer->Server

Types Conforming to Server

HTTPServer

Requirements

on​Shutdown

var onShutdown: EventLoopFuture<Void>

start(address:​)

func start(address: BindAddress?) throws

Start the server with the specified address.

Parameters

address Bind​Address?

The address to start the server with.

start(hostname:​port:​)

@available(*, deprecated, renamed: "start(address:)", message: "Please use `start(address: .hostname(hostname, port: port))` instead") 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.

  • Deprecated: Please use start(address: .hostname(hostname, port: port)) instead.

Parameters

hostname String?

The hostname to start the server with, or nil if the default one should be used.

port Int?

The port to start the server with, or nil if the default one should be used.

shutdown()

func shutdown()