Skip to content

Instantly share code, notes, and snippets.

@jergason
Created October 12, 2014 15:16
Show Gist options
  • Save jergason/b3d6d4d424582c7865bb to your computer and use it in GitHub Desktop.
Save jergason/b3d6d4d424582c7865bb to your computer and use it in GitHub Desktop.
compojure example
(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