|
|
11 years ago | |
|---|---|---|
| Common | 11 years ago | |
| Resources | 11 years ago | |
| Swifter | 11 years ago | |
| Swifter.xcodeproj | 11 years ago | |
| SwifterOSX | 11 years ago | |
| .gitignore | 11 years ago | |
| LICENSE | 12 years ago | |
| README.md | 11 years ago | |
| github.png | 12 years ago | |
| github_code.png | 12 years ago |
Tiny http server engine written in Swift ( https://developer.apple.com/swift/ ) programming language.
How to start ?
let server = HttpServer()
server["/hello"] = { .OK(.HTML("You asked for " + $0.url)) }
server.start()
How to share files ?
let server = HttpServer()
server["/home/(.+)"] = HttpHandlers.directory("~/")
server.start()
How to redirect ?
let server = HttpServer()
server["/redirect"] = { request in
return .MovedPermanently("http://www.google.com")
}
server.start()