Mercurial > laserkard
diff server.clj @ 106:5b0753c6f34d laserkard tip
updated to newest compojure and a simpler syntax
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Mon, 27 Sep 2010 20:22:58 -0400 |
parents | 874a6a2c28cf |
children |
line wrap: on
line diff
1.1 --- a/server.clj Mon Sep 27 17:47:08 2010 -0400 1.2 +++ b/server.clj Mon Sep 27 20:22:58 2010 -0400 1.3 @@ -1,22 +1,24 @@ 1.4 (ns laserkard.server 1.5 - (:use (compojure.http request servlet session routes) 1.6 - (compojure.server jetty) 1.7 - (compojure control) 1.8 - (laserkard buy-temp faq) 1.9 + (:use 1.10 + [compojure core] 1.11 + [ring.adapter jetty] 1.12 + [laserkard buy-temp faq]) 1.13 + ) 1.14 1.15 -)) 1.16 - 1.17 -(defroutes example 1.18 +(defroutes laserkard 1.19 (GET "/index.clj" [] "<h1> hello, connie, good to meet you</h1>") 1.20 (GET "/buy-temp.clj" [] (buy-gen)) 1.21 (GET "/faq.clj" [] (faq)) 1.22 ) 1.23 1.24 +(defn serve [] 1.25 + (future 1.26 + (run-jetty (var laserkard.server/laserkard) {:port 9000 :host "localhost"}))) 1.27 1.28 1.29 -(defserver laserkard-server 1.30 - {:port 9000 :host "localhost"} 1.31 - "/*" (servlet example)) 1.32 +;(defserver laserkard-server 1.33 +; {:port 9000 :host "localhost"} 1.34 +; "/*" (servlet example)) 1.35 1.36 1.37