Package list comidi-clojure / d4bee8b
Merge pull request #21 from scottyw/update-readme-for-wrap-routes Upversion to 0.3.0 and update README to describe (wrap-routes ...) Ruth Linehan 6 years ago
3 changed file(s) with 16 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
22
33 Added mechanism for wrapping intermediate comidi routes with middleware.
44 Added support for "true/false" Bidi patterns.
5
6 ## 0.2.2
7
8 Same content as 0.3.0 - please prefer that version
59
610 ## 0.2.1
711
4545 does.
4646
4747 Other than those differences, the API should be very close to compojure's.
48
49 You can apply a Ring middlware to all the handlers at the leaves of a route using ```wrap-routes```, which has behaviour analagous to its counterpart in compojure. Multiple middlewares can be applied to the same routes, with those applied later wrapped around those applied earlier. This allows you to create multiple routes wrapped with different middleware yet still combine them into one overarching route that can be introspected.
50
51 ```clj
52 (let [my-routes ...
53 my-singly-wrapped-routes (wrap-routes my-routes inner-middleware)
54 my-doubly-wrapped-routes (wrap-routes my-singly-wrapped-routes outer-middleware)
55 my-other-routes ...
56 my-wrapped-other-routes (wrap-routes my-other-routes other-middleware)
57 my-combined-routes (routes my-doubly-wrapped-routes my-wrapped-other-routes)]
58 ```
4859
4960 ## What does Comidi do?
5061
0 (defproject puppetlabs/comidi "0.2.3-SNAPSHOT"
0 (defproject puppetlabs/comidi "0.3.0-SNAPSHOT"
11 :description "Puppet Labs utility functions and compojure-like wrappers for use with the bidi web routing library"
22 :url "https://github.com/puppetlabs/comidi"
33