Created
December 2, 2011 06:21
-
-
Save andrewvc/1422042 to your computer and use it in GitHub Desktop.
Noir Examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Define the route, and specify that we want the 'garden-file' param | |
(defpage [:post "/upload"] {:keys [garden-file]} | |
; do some work | |
(let [{:keys [decoded-file uuid]} (decode-upload garden-file)] | |
(try | |
(garden/create uuid decoded-file) | |
(finally | |
(.delete decoded-file))) | |
; render some HTML based on that work | |
(common/layout [:p (format "File %s was created" uuid)])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defpage "/welcome" [] | |
"Welcome to Noir!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(html/html5 [:h2 "◉ Recent Gardens"] | |
[:ul {:id "recent"} | |
(map (fn [uuid] [:li (link-to (str "/gardens/" uuid) uuid)]) | |
(garden/recent))]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment