HTTP服務器Swift開發包:Swift Taylor

jopen 11年前發布 | 17K 次閱讀 Apple Swift開發 Swift Taylor

Taylor 是一個用 Swift 編寫 HTTP 服務器的開發包。

進展

當前,Taylor只支持 GET 和 POST HTTP 請求。它依賴于 xcodebuild 來編譯該binary,that's the reason of the existance of the Taylor.xcodeproj file。

let taylor = Taylor(port: 5000)

taylor.get("/") {

   request, response in

    response.stringBody = "Hello World"
    response.send()

    return nil
}

taylor.startListening(forever: true)


項目主頁:http://www.baiduhome.net/lib/view/home/1409123200150

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!