The simple web server is based on example 16-1 in "Clojure Programming" by Chas Emerick. I add it into a clojure project created by leiningen.
$ lein new app ring-server
$ cd ring-server
// Add "[ring "1.0.0"]" into ":dependencies" of project.clj
$ vi src/ring-server/core.clj
$ cat src/ring-server/core.clj
(ns ring-server.core
(:gen-class))
(use '[ring.adapter.jetty :only (run-jetty)])
(defn app
[{:keys [uri query-string]}]
{:body (format "You requested %s with query %s" uri query-string)})
(defn -main
"this is a ring server"
[port]
(run-jetty #'app {:port (bigdec port) :join? false}))
$ lein run -m ring-server.core 8082
Now open http://localhost:8082/hello?at=china in your browser, you can see "You requested /hello with query at=china".