Permalink
Browse files

cheshire json

  • Loading branch information...
jflinchbaugh committed Mar 5, 2018
1 parent 7d16829 commit 5e0716092d1cc4e0429402a03cfb63cd746e897b
Showing with 11 additions and 3 deletions.
  1. +2 −1 project.clj
  2. +9 −2 src/cheshire_cat/handler.clj
View
@@ -4,7 +4,8 @@
:min-lein-version "2.0.0"
:dependencies [[org.clojure/clojure "1.8.0"]
[compojure "1.5.1"]
[ring/ring-defaults "0.2.1"]]
[ring/ring-defaults "0.2.1"]
[cheshire "5.8.0"]]
:plugins [[lein-ring "0.9.7"]]
:ring {:handler cheshire-cat.handler/app}
:profiles
@@ -1,11 +1,18 @@
(ns cheshire-cat.handler
(:require [compojure.core :refer :all]
[compojure.route :as route]
[ring.middleware.defaults :refer [wrap-defaults site-defaults]]))
[ring.middleware.defaults :refer [wrap-defaults site-defaults]]
[cheshire.core :as json]))
(defroutes app-routes
(GET "/" [] "Hello World")
(GET "/cheshire-cat" [] "Smile")
(GET "/cheshire-cat" [] {
:status 200
:headers {"Content-type" "application/json;charset=utf-8"}
:body (json/generate-string
{
:name "Cheshire Cat"
:status :grinning})})
(route/not-found "Not Found"))
(def app

0 comments on commit 5e07160

Please sign in to comment.