Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ikitommi committed Dec 20, 2016
1 parent a986c44 commit 4656d68
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ See [Live demo](https://kekkonen.herokuapp.com/) & [Wiki](https://github.com/met

Quickstart: `lein new kekkonen kakkonen`

## Example handler
## Basic building blocks

### Handler

```clj
{:name "plus"
{:name ::plus
:type :handler
:interceptors []
:input {:data {:y s/Int
Expand All @@ -43,6 +45,16 @@ Quickstart: `lein new kekkonen kakkonen`
(+ x y))}
```

### Interceptor

```clj
{:name ::require-roles
:enter (fn [context]
(let [roles (-> context :user :roles)]
(if (seq (clojure.set/intersection roles required))
context)))}
```

## Hello World (local dispatch)

```clj
Expand Down

0 comments on commit 4656d68

Please sign in to comment.