0
0
zero/config.ru
Gibheer 79537632ac 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.
2012-10-13 11:48:11 +02:00

17 lines
303 B
Ruby

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