Swift 2016-03-04 21:24
Swift 轻量级Web服务器 Taylor
回复:0 查看:5189 感兴趣:95 赞:1
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)") }