Lightweight request routing for Nest. Turnstone allows you to register a URI Template against a handler to provide request routing.
pod 'Turnstone'
import Turnstone
import Inquiline
let turnstone = Turnstone()
turnstone.addRoute("/") { request in
return Response(.Ok, body: "Root URI")
}
turnstone.addRoute("/tasks/{id}") { request, parameters in
let id = parameters["id"]!
return Response(.Ok, body: "Task \(id)")
}
serve("localhost", 8080, turnstone.nest)
Turnstone is released under the BSD license. See LICENSE.