summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlo Zancanaro <carlo@zancanaro.id.au>2014-02-14 00:10:32 +1100
committerCarlo Zancanaro <carlo@zancanaro.id.au>2014-02-14 00:10:32 +1100
commit07af09cc90b5b6eb66c75a06edf643bea6ce5754 (patch)
treef5dc3222c57c17cc25f5d87462809997473fe3c1
parentb881f4378660134597b68d30a2596d8d4bbb8729 (diff)
Syntax highlighting for README.md on bitbucket
-rw-r--r--README.md5
1 files changed, 5 insertions, 0 deletions
diff --git a/README.md b/README.md
index be9f685..72d6312 100644
--- a/README.md
+++ b/README.md
@@ -10,6 +10,7 @@ applications.
Include `abra` by adding the following to your dependencies:
+ :::clojure
[org.clojars.czan/abra "0.1.0"]
At the very bottom of your middleware stack (closest to your actual
@@ -22,6 +23,7 @@ Instead of `compojure.core/`{`defroutes`,`routes`,`context`}, use
As an example:
+ :::clojure
(require '[abra.core :refer [routes context] :as abra])
(def app (-> (routes (context "/api" []
(-> #'api-routes
@@ -33,6 +35,7 @@ As an example:
When giving a route a name, wrap it in a call to
`abra.core/register-route`:
+ :::clojure
(defroutes site-routes
(register-route :username
(GET "/username/" []
@@ -43,6 +46,7 @@ methods: `GET`, `POST`, `PUT`, `DELETE`, `HEAD` and `ANY`.
To later retrieve this url, use the `abra.core/url-for` function:
+ :::clojure
(defroutes api-routes
(GET "/" []
(str "url: " (url-for :username))))
@@ -53,6 +57,7 @@ used for the url, although this information may be exposed in future.
A route may also require parameters, in which case the `url-for`
function must be provided the correct number of additional parameters:
+ :::clojure
(defroutes test-routes
(context "/user/:id" [id]
(register-route :user-attr