Permalink
Browse files

initial commit

  • Loading branch information...
jflinchbaugh committed Mar 3, 2018
0 parents commit 1ba4135d48e63da2316f3851652c01c6a4dcb445
Showing with 66 additions and 0 deletions.
  1. +10 −0 .gitignore
  2. +19 −0 README.md
  3. +12 −0 project.clj
  4. +11 −0 src/cheshire_cat/handler.clj
  5. +14 −0 test/cheshire_cat/handler_test.clj
@@ -0,0 +1,10 @@
/target
/lib
/classes
/checkouts
pom.xml
pom.xml.asc
*.jar
*.class
/.lein-*
/.nrepl-port
@@ -0,0 +1,19 @@
# cheshire-cat
FIXME
## Prerequisites
You will need [Leiningen][] 2.0.0 or above installed.
[leiningen]: https://github.com/technomancy/leiningen
## Running
To start a web server for the application, run:
lein ring server
## License
Copyright © 2018 FIXME
@@ -0,0 +1,12 @@
(defproject cheshire-cat "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:min-lein-version "2.0.0"
:dependencies [[org.clojure/clojure "1.8.0"]
[compojure "1.5.1"]
[ring/ring-defaults "0.2.1"]]
:plugins [[lein-ring "0.9.7"]]
:ring {:handler cheshire-cat.handler/app}
:profiles
{:dev {:dependencies [[javax.servlet/servlet-api "2.5"]
[ring/ring-mock "0.3.0"]]}})
@@ -0,0 +1,11 @@
(ns cheshire-cat.handler
(:require [compojure.core :refer :all]
[compojure.route :as route]
[ring.middleware.defaults :refer [wrap-defaults site-defaults]]))
(defroutes app-routes
(GET "/" [] "Hello World")
(route/not-found "Not Found"))
(def app
(wrap-defaults app-routes site-defaults))
@@ -0,0 +1,14 @@
(ns cheshire-cat.handler-test
(:require [clojure.test :refer :all]
[ring.mock.request :as mock]
[cheshire-cat.handler :refer :all]))
(deftest test-app
(testing "main route"
(let [response (app (mock/request :get "/"))]
(is (= (:status response) 200))
(is (= (:body response) "Hello World"))))
(testing "not-found route"
(let [response (app (mock/request :get "/invalid"))]
(is (= (:status response) 404)))))

0 comments on commit 1ba4135

Please sign in to comment.