Permalink
Browse files

Adding regex route

  • Loading branch information...
1 parent 711a871 commit 4d20d5ddfc2ffd7f7635ef85f0ec39a5809506f6 @jc00ke committed Mar 2, 2010
Showing with 14 additions and 0 deletions.
  1. +5 −0 example/sinazzy.rb
  2. +9 −0 sinatra/sinatra.md
View
@@ -17,3 +17,8 @@
put '/change/something' do
"Changed or something"
end
+
+get %r{/I/am/([\d]+)/years/old} do |age|
+ puts age # write to the logger. sometimes helpful.
+end
+
View
@@ -101,4 +101,13 @@
$ curl localhost:4567/i/dislike/puppies
I dislike puppies too!
+!SLIDE
+# You like regular expressions, right? #
+
+ @@@ ruby
+
+ get %r{/I/am/([\d]+)/years/old} do |age|
+ puts age # write to the logger. sometimes helpful.
+ end
+

0 comments on commit 4d20d5d

Please sign in to comment.