Created
September 9, 2013 23:18
-
-
Save tdreyno/6502823 to your computer and use it in GitHub Desktop.
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
(defn home-api-map | |
[] | |
{ :banner (model/pick :banner {:where {:slug "home"}}) | |
:intro-headline (model/pick :headline {:where {:slug "intro"}}) | |
:intro-slides (model/gather :slides {:where {:slug "intro"} :include {:slides {}}}) | |
:intro-highlights (model/gather :highlight {:where {:slug "intro"}}) | |
:tenants (model/gather :tenant) | |
:partners (model/gather :neighborhood-partner) | |
:whats-here-headline (model/pick :headline {:where {:slug "whats-here"}}) | |
:project-highlights (model/gather :project-highlights {:include {:highlights {}}}) | |
:contact-headline (model/pick :headline {:where {:slug "contact"}}) | |
:leasing (model/pick :leasing-info {:include {:contacts {}}}) }) | |
(defn home-api-response | |
[] | |
{ :status 200 | |
:headers { "Content-Type" "application/json" } | |
:body (cheshire/generate-string { :response (home-api-map) }) }) | |
(defn home-json-api | |
[request] | |
; Cache for an hour | |
(timed/cached home-api-response (* 1000 60 60))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment