Created
October 26, 2016 02:46
-
-
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
This file contains 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 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)) |
This file contains 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
(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