Created
May 31, 2010 15:32
-
-
Save christianberg/419939 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
(defn render-post [post] | |
"Renders a post to HTML." | |
[:div | |
[:h2 (h (:title post))] | |
[:p (h (:body post))]]) | |
(defn get-posts [] | |
"Returns all posts stored in the datastore." | |
(ds/find-all (Query. "post"))) | |
(defn main-page [] | |
"Renders the main page by displaying all posts." | |
(render-page "Compojure on GAE" | |
(map render-post (get-posts)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment