Skip to content

Instantly share code, notes, and snippets.

@weavejester
Created August 13, 2011 12:37
Show Gist options
  • Select an option

  • Save weavejester/1143808 to your computer and use it in GitHub Desktop.

Select an option

Save weavejester/1143808 to your computer and use it in GitHub Desktop.
(ns hello-world.core
(:use compojure.core
ring.util.response)
(:require [compojure.route :as route]
[compojure.handler :as handler]))
(defroutes d3-routes
(GET "/" [] (redirect "/index.html"))
(GET "/test" [] "hello.")
(route/resources "/"))
(def app
(handler/site d3-routes))
$ rm -rf lib classes
$ lein deps
Copying 15 files to /home/jim/Development/hello-world/lib
$ lein repl
REPL started; server listening on localhost port 21135
user=> (require 'hello-world.core)
nil
user=> (use 'ring.adapter.jetty)
nil
user=> (run-jetty #'hello-world.core/app {:port 3000 :join? false})
2011-08-13 13:34:10.254:INFO::Logging to STDERR via org.mortbay.log.StdErrLog
2011-08-13 13:34:10.255:INFO::jetty-6.1.26
2011-08-13 13:34:10.311:INFO::Started SocketConnector@0.0.0.0:3000
#<Server Server@1d753b7>
user=> (require 'hello-world.core :reload)
nil
user=>
(defproject hello-world "1.0.0-SNAPSHOT"
:description "FIXME: write"
:dependencies [[org.clojure/clojure "1.3.0-beta1"]
[compojure "0.6.5"]
[ring/ring-jetty-adapter "0.3.11"]])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment