Mercurial > laserkard
annotate 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 |
rev | line source |
---|---|
rlm@69 | 1 (ns laserkard.server |
rlm@106 | 2 (:use |
rlm@106 | 3 [compojure core] |
rlm@106 | 4 [ring.adapter jetty] |
rlm@106 | 5 [laserkard buy-temp faq]) |
rlm@106 | 6 ) |
rlm@71 | 7 |
rlm@106 | 8 (defroutes laserkard |
rlm@71 | 9 (GET "/index.clj" [] "<h1> hello, connie, good to meet you</h1>") |
rlm@75 | 10 (GET "/buy-temp.clj" [] (buy-gen)) |
rlm@75 | 11 (GET "/faq.clj" [] (faq)) |
rlm@71 | 12 ) |
rlm@71 | 13 |
rlm@106 | 14 (defn serve [] |
rlm@106 | 15 (future |
rlm@106 | 16 (run-jetty (var laserkard.server/laserkard) {:port 9000 :host "localhost"}))) |
rlm@71 | 17 |
rlm@69 | 18 |
rlm@106 | 19 ;(defserver laserkard-server |
rlm@106 | 20 ; {:port 9000 :host "localhost"} |
rlm@106 | 21 ; "/*" (servlet example)) |
rlm@69 | 22 |
rlm@69 | 23 |
rlm@69 | 24 |
rlm@69 | 25 |
rlm@70 | 26 |
rlm@70 | 27 |