Created
October 12, 2014 15:16
-
-
Save jergason/b3d6d4d424582c7865bb to your computer and use it in GitHub Desktop.
compojure example
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
(ns durp.handler | |
(:require [compojure.core :as cc] | |
[compojure.handler :as handler] | |
[ring.util.response :refer [response]] | |
[ring.middleware.json :as json])) | |
(cc/defroutes app-routes | |
(cc/POST "/user/:user-id" [user-id {:body body}] (response (body)))) | |
(def app | |
(-> | |
(handler/site app-routes) | |
(json/wrap-json-body) | |
(json/wrap-json-params) | |
(json/wrap-json-response))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment