Taylor是一个轻量级Swift Web服务器。
示例代码:
import Taylor let server = Taylor.Server() server.get("/") { req, res in res.bodyString = "Hello, world!" return .Send } let port = 3002 do { print("Starting server on port: \(port)") try server.serveHTTP(port: port, forever: true) } catch { print("Server start failed \(error)") }