Skip to content

Instantly share code, notes, and snippets.

@ahoy-jon
Last active January 2, 2016 02:49
Show Gist options
  • Save ahoy-jon/8240079 to your computer and use it in GitHub Desktop.
Save ahoy-jon/8240079 to your computer and use it in GitHub Desktop.
(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]]])]
}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment