Skip to content

kylef-archive/Turnstone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Turnstone

Build Status

Lightweight request routing for Nest. Turnstone allows you to register a URI Template against a handler to provide request routing.

Installation

pod 'Turnstone'

Usage

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)

License

Turnstone is released under the BSD license. See LICENSE.

About

Lightweight request routing for Nest

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages