Browse files

Updated README with Ring request example

  • Loading branch information...
1 parent 2926ddd commit d9b736f4e2fb4773fed14e4049e6b6bed2309704 @weavejester committed Oct 25, 2009
Showing with 10 additions and 1 deletion.
  1. +10 −1 README.markdown
View
11 README.markdown
@@ -14,6 +14,15 @@ Here is an example of use:
user=> (route-matches "/public/*" "/public/style/screen.css")
{:* "style/screen.css"}
+Clout can also match Ring requests:
+
+ user=> (route-matches "/book/:id"
+ {:request-method :get
+ :headers {"Host" "example.com"}
+ :uri "/book/123"}
+ :body nil})
+ {:id "123"}
+
Clout supports both keywords and wildcards. Keywords (like ":title") will
match any character but the following: `/ . , ; ?`. Wildcards will match
anything.
@@ -23,7 +32,7 @@ If a route does not match, nil is returned:
user=> (route-matches "/products" "/articles")
nil
-For additional performance you can choose to pre-compile routes:
+For additional performance, you can choose to pre-compile a route:
user=> (def user-route (route-compile "/user/:id"))
#'user/user-route

0 comments on commit d9b736f

Please sign in to comment.