From 79537632ac62957f1de6f189878d6757b0dd6abb Mon Sep 17 00:00:00 2001 From: Gibheer Date: Thu, 11 Oct 2012 06:38:55 +0200 Subject: added new router to the tools This small router is intended to work like URLMap, but with the feature that it can extract variables from routes. --- config.ru | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 config.ru (limited to 'config.ru') diff --git a/config.ru b/config.ru new file mode 100644 index 0000000..c2c7c62 --- /dev/null +++ b/config.ru @@ -0,0 +1,16 @@ +require File.expand_path('../lib/zero.rb', __FILE__) +require 'json' + +class Foo + def call(env) + req = Rack::Request.new(env) + [200, {'Content-Type' => 'text/html'}, ["this works #{req.params.inspect}"]] + end +end + +routes = Zero::Router.new( + '/foo/:id' => Foo.new, + '/' => Foo.new +) + +run routes -- cgit v1.2.3-70-g09d2