Skip to content

Instantly share code, notes, and snippets.

@pjagielski
Last active October 2, 2015 13:24
Show Gist options
  • Save pjagielski/9031e83a7ef3a16d05d5 to your computer and use it in GitHub Desktop.
Save pjagielski/9031e83a7ef3a16d05d5 to your computer and use it in GitHub Desktop.
lein new duct clojure-web-app +example
lein repl
(go)
[ring/ring-json "0.3.1"]
[cheshire "5.1.1"]
[ring.middleware.json :refer [wrap-json-body wrap-json-response]]
[wrap-json-body {:keywords? true}]
[wrap-json-response]
[ring.util.response :refer [response]]
(GET "/hello" [] (response {:hello "world"}))
curl -v http://localhost:3000/hello
[lein-figwheel "0.3.9"]
:cljsbuild
{:builds [{:id "dev"
:source-paths ["src-cljs"]
:figwheel true
:compiler {:main "clojure-web-app.core"
:asset-path "js/out"
:output-to "resources/public/js/clojure-web-app.js"
:output-dir "resources/public/js/out"}}]}
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div id="main">
</div>
<script src="js/clojure-web-app.js" type="text/javascript"></script>
</body>
</html>
(GET "/" [] (io/resource "public/index.html"))
(ns ^:figwheel-always clojure-web-app.core)
(enable-console-print!)
(println "hello from clojurescript")
rlwrap lein figwheel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment