Taylor是一個輕量級Swift Web服務(wù)器。
示例代碼:
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)") }