From 07af09cc90b5b6eb66c75a06edf643bea6ce5754 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Fri, 14 Feb 2014 00:10:32 +1100 Subject: Syntax highlighting for README.md on bitbucket --- README.md | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'README.md') 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 -- cgit v1.2.3