Disclaimer: It is a work in progress, it may break. Use it at your own risk.
Taylor is a library which allows you to create web server applications in Swift
At this moment, Taylor only supports GET and POST HTTP requests.
It relies on xcodebuild
to compile the 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)
You need to be running xCode 6 beta 2 or latest
$ git clone http://github.com/izqui/Taylor taylor-server
$ cd taylor-server
# edit main.swift
$ ./run 3000
Open localhost:3000
Coming soon
Right now Taylor relies on an Objective-C library called GCDAsyncSocket. I want to do my own implementation in Swift in the future.