Skip to content

Instantly share code, notes, and snippets.

@christianberg
Created May 31, 2010 15:32
Show Gist options
  • Save christianberg/419939 to your computer and use it in GitHub Desktop.
Save christianberg/419939 to your computer and use it in GitHub Desktop.
(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