Created
March 30, 2015 00:18
-
-
Save ryancole/c4fd8222818e6fa64b7a 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
(ns replays.handler | |
(:require [compojure.core :refer [GET defroutes]] | |
[compojure.route :as route] | |
[ring.util.response :refer [response resource-response]] | |
[ring.middleware.json :as json] | |
[ring.middleware.defaults :refer [wrap-defaults api-defaults]])) | |
(defroutes app-routes | |
(GET "/" [] (resource-response "index.html" {:root "public"})) | |
(GET "/widgets" [] (response [{:name "Widget 1"} {:name "Widget 2"}])) | |
(route/resources "/public") | |
(route/not-found "not found")) | |
(def app | |
(-> app-routes | |
(json/wrap-json-body) | |
(json/wrap-json-response) | |
(wrap-defaults api-defaults))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment