CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Wed, 20 Aug 2025 11:27:06 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20100328234020
location: https://web.archive.org/web/20100328234020/https://github.com/josh/rack-mount
server-timing: captures_list;dur=0.898665, exclusion.robots;dur=0.026099, exclusion.robots.policy;dur=0.011979, esindex;dur=0.014257, cdx.remote;dur=29.992020, LoadShardBlock;dur=170.105889, PetaboxLoader3.resolve;dur=69.261465, PetaboxLoader3.datanode;dur=39.293522
x-app-server: wwwb-app213
x-ts: 302
x-tr: 248
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=1
set-cookie: wb-p-SERVER=wwwb-app213; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Wed, 20 Aug 2025 11:27:06 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.7.61
x-archive-orig-date: Sun, 28 Mar 2010 23:40:20 GMT
x-archive-orig-connection: close
x-archive-orig-status: 200 OK
x-archive-orig-etag: "1ea795f18fb59ec15631b0bdbf9248fa"
x-archive-orig-x-runtime: 466ms
x-archive-orig-content-length: 23589
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Sun, 28 Mar 2010 23:40:20 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Sun, 05 Jul 2009 06:02:48 GMT", ; rel="prev memento"; datetime="Mon, 15 Feb 2010 05:21:04 GMT", ; rel="memento"; datetime="Sun, 28 Mar 2010 23:40:20 GMT", ; rel="next memento"; datetime="Tue, 30 Mar 2010 14:23:53 GMT", ; rel="last memento"; datetime="Fri, 27 Jun 2025 06:01:09 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 51_15_20100328204616_crawl103_IndexOnly-c/51_15_20100328233718_crawl101.arc.gz
server-timing: captures_list;dur=0.817236, exclusion.robots;dur=0.033299, exclusion.robots.policy;dur=0.015782, esindex;dur=0.018833, cdx.remote;dur=7.391855, LoadShardBlock;dur=161.365082, PetaboxLoader3.resolve;dur=282.405516, PetaboxLoader3.datanode;dur=75.154508, load_resource;dur=219.054054
x-app-server: wwwb-app213
x-ts: 200
x-tr: 478
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
josh's rack-mount at master - GitHub
josh / rack-mount
- Source
- Commits
- Network (4)
- Issues (2)
- Graphs
-
Branch:
master
click here to add a description
click here to add a homepage
name | age | message | |
---|---|---|---|
![]() |
LICENSE | Fri Oct 09 21:46:15 -0700 2009 | just LICENSE [josh] |
![]() |
README.rdoc | Thu Nov 12 20:26:07 -0800 2009 | fix syntax error in readme [josh] |
![]() |
Rakefile | Thu Feb 18 19:44:45 -0800 2010 | kill old rdoc tasks [josh] |
![]() |
benchmark/ | Sat Jan 23 08:15:26 -0800 2010 | optimize permutation iterator [josh] |
![]() |
lib/ | Mon Mar 15 12:58:59 -0700 2010 | merge route recognize into route set [josh] |
![]() |
test/ | Tue Mar 09 20:43:34 -0800 2010 | drop mixover [josh] |
README.rdoc
Rack::Mount
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 from a database.
Usage
Rack::Mount provides a plugin API to build custom DSLs on top of.
The API is extremely minimal and only 3 methods are exposed as the public API.
Rack::Mount::RouteSet#add_route: | builder method for adding routes to the set |
Rack::Mount::RouteSet#call: | Rack compatible recognition and dispatching method |
Rack::Mount::RouteSet#url: | generates path from identifiers or significant keys |
Example
require 'rack/mount' Routes = Rack::Mount::RouteSet.new do |set| # add_route takes a rack application and conditions to match with # conditions may be strings or regexps # See Rack::Mount::RouteSet#add_route for more options. set.add_route FooApp, :method => 'get', :path => %{/foo} end # The route set itself is a simple rack app you mount run Routes