With leiningen http://leiningen.org/
lein new clojure-into
You can then open your project in LightTable http://www.lighttable.com/ and start hacking !
The magic (pull) comes from https://github.com/zcaudate/vinyasa. :)
With leiningen http://leiningen.org/
lein new clojure-into
You can then open your project in LightTable http://www.lighttable.com/ and start hacking !
The magic (pull) comes from https://github.com/zcaudate/vinyasa. :)
(ns clojure-intro.core) | |
(pull 'compojure) | |
(pull 'ring/ring-jetty-adapter) | |
(pull 'org.clojure/data.json) | |
(require '[clojure.data.json :as json]) | |
(extend-protocol json/JSONWriter | |
org.eclipse.jetty.server.HttpInput | |
(-write [object out] (.print out (str object)))) | |
(use 'compojure.core) | |
(pull 'hiccup) | |
(use 'hiccup.core) | |
(defroutes app | |
(GET "/" [] (html [:a {:href "/ahoy"} "Hello"] )) | |
(GET "/ahoy" [] "Ahoy")) | |
(do (use 'ring.adapter.jetty) | |
(defonce server (run-jetty #'app {:port 8080 :join? false}))) |
;; My ~/.lein/profiles.clj | |
{:user {:plugins [[lein-clojars "0.9.1"] | |
[lein-deps-tree "0.1.2"] | |
[lein-localrepo "0.5.3"]] | |
:dependencies [[im.chit/vinyasa "0.1.5"]] | |
:injections [(require 'vinyasa.inject) | |
(vinyasa.inject/inject 'clojure.core | |
'[[vinyasa.inject [inject inject]] | |
[vinyasa.pull [pull pull]] | |
[clojure.pprint [pprint >pprint]]])] | |
}} |