Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Latest commit

 

History

40 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A stackable dynamic tree based Rack router.

Rack::Mount supports Rack’s Cascade style of trying several routes until it finds one that is not a 404. This allows multiple routes to be nested or stacked on top of each other. Since the application endpoint can trigger the router to continue matching, middleware can be used to add arbitrary conditions to any route. This allows you to route based on other request attributes, session information, or even data dynamically pulled pulled from a database.

Currently, Rack::Mount supports the classic Rails router mapping API. (Support is planned for the Merb router API and the new Rails 3.0 API)

require 'rack/mount'
Routes = Rack::Mount::RouteSet.new

Routes.draw do |map|
  map.connect 'products', :app => ListProducts
  map.connect 'products/:id', :app => ShowProduct
end

run Routes

About

Stackable dynamic tree based Rack router

Resources

Stars

7 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors