Skip to content

Instantly share code, notes, and snippets.

@base698
Created October 26, 2016 02:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save base698/3b31024e5f26678863a4087938b6d936 to your computer and use it in GitHub Desktop.
Save base698/3b31024e5f26678863a4087938b6d936 to your computer and use it in GitHub Desktop.
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