TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | BSD |
ReleasedLast Release | Sep 2015 |
SPMSupports SPM | ✗ |
Maintained by Kyle Fuller.
Depends on: | |
Nest | ~> 0.2.0 |
Inquiline | ~> 0.2.0 |
URITemplate | ~> 1.3 |
Lightweight request routing for Nest. Turnstone allows you to register a URI Template against a handler to provide request routing.
pod 'Turnstone'
import Turnstone
var turnstone = Turnstone()
turnstone.addRoute("/") { environ, parameters in
return ("200 OK", [], "Root URI")
}
turnstone.addRoute("/tasks/{id}") { environ, parameters in
let id = parameters["id"]!
return ("200 OK", [], "Task \(id)")
}
serve("localhost", 8080, turnstone.nest)
Turnstone is released under the BSD license. See LICENSE.