Kitura

public class Kitura

A set of helper functions to make it easier to create, start, and stop Kitura based servers.

  • Add an HTTPServer on a port with a delegate.

    The server is only registered with the framework, it does not start listening on the port until Kitura.run() or Kitura.start() is called.

    Declaration

    Swift

    public class func addHTTPServer(onPort port: Int, with delegate: ServerDelegate, withSSL sslConfig: SSLConfig?=nil) -> HTTPServer

    Parameters

    onPort

    The port to listen on.

    with

    The ServerDelegate to use.

    withSSL

    The sslConfig to use.

    Return Value

    The created HTTPServer.

  • Add a FastCGIServer on a port with a delegate.

    The server is only registered with the framework, it does not start listening on the port until Kitura.run() or Kitura.start() is called.

    Declaration

    Swift

    public class func addFastCGIServer(onPort port: Int, with delegate: ServerDelegate) -> FastCGIServer

    Parameters

    onPort

    The port to listen on.

    with

    The ServerDelegate to use.

    Return Value

    The created FastCGIServer.

  • Start the Kitura framework.

    Make all registered servers start listening on their port.

    Note

    This function never returns - it should be the last call in your main.swift

    Declaration

    Swift

    public class func run()
  • Start all registered servers and return

    Make all registered servers start listening on their port.

    Declaration

    Swift

    public class func start()
  • Stop all registered servers

    Make all registered servers stop listening on their port.

    Declaration

    Swift

    public class func stop(unregister: Bool = true)

    Parameters

    unregister

    If servers should be unregistered after stopped (default true).