|
|
há 11 anos atrás | |
|---|---|---|
| Common | há 11 anos atrás | |
| Resources | há 11 anos atrás | |
| Swifter | há 11 anos atrás | |
| Swifter.xcodeproj | há 11 anos atrás | |
| SwifterOSX | há 11 anos atrás | |
| .gitignore | há 11 anos atrás | |
| LICENSE | há 12 anos atrás | |
| README.md | há 11 anos atrás | |
| github.png | há 12 anos atrás | |
| github_code.png | há 12 anos atrás |
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()