0.0
No commit activity in last 3 years
No release in over 3 years
Rack router
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 1.6
 Project Readme

Spine::Routing

Gem Version Dependency Status Test Coverage Code Climate security Inline docs Codeship Status for rspine/routing

Router for Rack application. Supports scopes, path parameters and HTTP verbs (GET, POST, PUT, PATCH, DELETE).

Installation

To install it, add the gem to your Gemfile:

gem 'spine-routing'

Then run bundle. If you're not using Bundler, just gem install spine-routing.

Usage

router = Spine::Routing::Router.new
router.configure do
  scope :users do
    get '', to: Users::List
    post ':id', to: Users::Add
  end

  get :status, to: -> (env) { [200, {}, []] }
end

router.call(env)

For getting parameters use env['router.parameters'] or include Spine::Routing::Parameters to your controller/action.