summaryrefslogtreecommitdiff
path: root/config.ru
diff options
context:
space:
mode:
authorGibheer <gibheer@gmail.com>2012-10-11 06:38:55 +0200
committerGibheer <gibheer@gmail.com>2012-10-13 11:48:11 +0200
commit79537632ac62957f1de6f189878d6757b0dd6abb (patch)
tree2ad80848505c04943639ebc838d89704b4402133 /config.ru
parent1c1bda6b66a13b41d53e8ea0bb46debe23ddfd6e (diff)
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.
Diffstat (limited to 'config.ru')
-rw-r--r--config.ru16
1 files changed, 16 insertions, 0 deletions
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