|
|
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)) }
How to share files ?
if let publicDir = publicDir {
server["/home/(.+)"] = HttpHandlers.directory("~/")
}
How to redirect ?
server["/redirect"] = { request in
return .MovedPermanently("http://www.google.com")
}