Last active
August 29, 2015 14:11
-
-
Save laser/f4bc6421b79bc47b05d2 to your computer and use it in GitHub Desktop.
Adding JSON middleware
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 pipeline.core | |
(:require [compojure.core :refer [POST defroutes]] | |
[ring.middleware.json :refer [wrap-json-response wrap-json-body]] | |
[ring.util.response :refer [response]]) | |
(:gen-class)) | |
(defn post-notes-handler | |
[req-body] | |
(response req-body)) | |
(defroutes router | |
(POST "/notes" {req-body :body} (post-notes-handler req-body))) | |
(def app | |
(-> router | |
wrap-json-body | |
(wrap-json-response {:keywords? true}))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment