Latest 0.2.0
Homepage https://github.com/kylef/Turnstone
License BSD
Platforms ios 8.0, osx 10.9, requires ARC
Dependencies Nest, Inquiline, URITemplate
Authors

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.

Latest podspec

{
    "name": "Turnstone",
    "version": "0.2.0",
    "summary": "Lightweight request routing for Nest using URI Template.",
    "homepage": "https://github.com/kylef/Turnstone",
    "license": {
        "type": "BSD",
        "file": "LICENSE"
    },
    "authors": {
        "Kyle Fuller": "[email protected]"
    },
    "social_media_url": "http://twitter.com/kylefuller",
    "source": {
        "git": "https://github.com/kylef/Turnstone.git",
        "tag": "0.2.0"
    },
    "source_files": "Turnstone/*.swift",
    "requires_arc": true,
    "platforms": {
        "ios": "8.0",
        "osx": "10.9"
    },
    "dependencies": {
        "Nest": [
            "~> 0.2.0"
        ],
        "Inquiline": [
            "~> 0.2.0"
        ],
        "URITemplate": [
            "~> 1.3"
        ]
    }
}

Pin It on Pinterest

Share This