response, next) in response.status(HttpStatusCode.OK).send("Hello, world").end() } // Deploy Kitura-app with Kitura-net let server = HttpServer.listen(8080, delegate: router) Server.run()
get } var path: String { get } var headers: [Header] { get } var body: PayloadType? { get set } } public protocol ResponseType { var statusLine: String { get } var headers: [Headers] { get } var body: PayloadType? { get set } } public typealias Application = RequestType -> ResponseType
RequestType -> ResponseType in return Response(status: .Ok) } // Deploy with http4swift import http4swift let server = HTTPServer(port: 8080)! server.serve(app)
AsyncResponder, on host: String, at port: Int ) throws } public protocol Server { func serve( _ responder: Responder, on host: String, at port: Int ) throws }