Skip to content

Commit

Permalink
Improve first README example explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
weavejester committed Sep 29, 2014
1 parent 46e6a01 commit e7370f9
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions README.md
Expand Up @@ -18,21 +18,34 @@ Add the following to your project.clj dependencies:

## Usage

These following examples make use of the [ring-mock][2] library to
generate Ring request maps.
Require Clout in the normal way:

```clj
(require '[clout.core :as clout])
```

These following examples also make use of the [ring-mock][2] library
to generate Ring request maps:

[2]: https://github.com/weavejester/ring-mock

```clj
(require '[clout.core :as clout]
'[ring.mock.request :as mock])
(require '[ring.mock.request :as mock])
```

Routes can match by keyword:

```clj
(clout/route-matches
"/article/:title"
(mock/request :get "/article/clojure"))

=> {:title "clojure"}
```

Or with wildcards:

```clj
(clout/route-matches
"/public/*"
(mock/request :get "/public/style/screen.css"))
Expand Down

0 comments on commit e7370f9

Please sign in to comment.