【文件属性】:
文件名称:swifter:用Swift编程语言编写的微型http服务器引擎
文件大小:1.87MB
文件格式:ZIP
更新时间:2021-02-03 17:00:22
swift http web server HTTPSwift
什么是Swifter?
用编程语言编写的微型http服务器引擎。
分行
* stable -落在CocoaPods等上。 支持最新的非beta XCode和SPM。 稳定。
* master稳定分支以及实验性Web框架层。
* 2.0 -Swifter的下一版本(异步IO)。 实验性的。
如何开始?
let server = HttpServer ()
server[ " /hello " ] = { . ok (. htmlBody ( " You asked for \( $0 ) " )) }
server. start ()
如何通过字符串加载HTML?
let server = HttpServer ()
server[path] = { request in
return HttpResponse. ok (. text ( " <html string> " ))
}
server. start ()
如何共享文件?
let server = HttpServer ()
server[ " /desktop/:path " ] = shareFile
【文件预览】:
swifter-master
----.swiftlint.yml(107B)
----XCode()
--------SwifterSampleiOS()
--------SwifterMac()
--------SwiftertvOS()
--------SwifterTestsCommon()
--------Resources()
--------SwifteriOSTests()
--------SwifterSampleOSX()
--------Swifter.xcodeproj()
--------SwifteriOS()
--------SwifterOSXTests()
--------SwifterSampletvOS()
----LICENSE(1KB)
----Sources()
--------TLS()
--------Swifter()
--------CSQLite()
----Package.swift(136B)
----.gitignore(525B)
----Swifter.podspec(637B)
----README.md(2KB)