Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Described Demo 2.

  • Loading branch information...
commit 1364839d467fa9bc98c5c3dee745fee08128976b 1 parent 6afcad4
@danskarda danskarda authored
Showing with 24 additions and 11 deletions.
  1. +24 −11 demo/demo-2-compojure/README.md
View
35 demo/demo-2-compojure/README.md
@@ -1,25 +1,38 @@
-# demo
+# Demo 2
project.clj
-----------
-For the second demo we included two libraries: hiccup and
-compojure.
+In our second demo we added two libraries to help us with Clojure
+development web development
- https://github.com/weavejester/hiccup
- https://github.com/weavejester/compojure
+* [Hiccup](https://github.com/weavejester/hiccup)
+* [Compojure](https://github.com/weavejester/compojure)
-For easier request handling we also added ring-core and
-ring-devel. Both include definition of ring "middleware".
+See [project.clj](project.clj) for changes.
Hiccup
------
-Hiccup is a library for HTML rendering from Clojure data
-structures
+Hiccup library uses Clojure data types to express HTML structure.
+HTML tree is expressed using vectors and list. Vectors start
+with element keyword and are optionally followed with map
+of attributes.
+
+See [page.clj](src/demo/page.clj) for hello-world example.
Compojure
---------
-Is a DSL (Domain Specific Language) for writing routing
-information for Ring.
+Compojure defines DSL (domain specific language) for request routing.
+In [core.clj](src/demo/core.clj) we use it fullfil request GET /.
+More complex examples will follow in Demo 3.
+
+Middleware
+----------
+
+Function `jetty-handler` in [core.clj](src/demo/core.clj) shows how
+you can extend basic jetty functionallity using middleware. `jetty-handler`
+is now composed from four independent parts - our routing function (`main-route`),
+then two functions for processing arguments and development utility which
+wraps any exception and produces readable output both in browser and in RPEL.
Please sign in to comment.
Something went wrong with that request. Please try again.