Skip to content

Instantly share code, notes, and snippets.

@base698 base698/handler.clj
Created Oct 26, 2016

Embed
What would you like to do?
You can create a template app with lein with: lein new compojure hello-world
(ns in-mem.handler
(:require [compojure.core :refer :all]
[compojure.route :as route]
[ring.middleware.defaults :refer [wrap-defaults site-defaults]]))
(def start (slurp "../../tests/start.json"))
(defroutes app-routes
(GET "/start" [] start)
(route/not-found "Not Found"))
(def app
(wrap-defaults app-routes site-defaults))
(defproject hello-world "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"]]
:jvm-opts ["-XX:+PreserveFramePointer"]
:ring {:handler in-mem.handler/app}
:profiles
{:dev {:dependencies [[javax.servlet/servlet-api "2.5"]
[ring/ring-mock "0.3.0"]]}})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.