Mercurial > laserkard
comparison 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 |
comparison
equal
deleted
inserted
replaced
105:3c398dd94f17 | 106:5b0753c6f34d |
---|---|
1 (ns laserkard.server | 1 (ns laserkard.server |
2 (:use (compojure.http request servlet session routes) | 2 (:use |
3 (compojure.server jetty) | 3 [compojure core] |
4 (compojure control) | 4 [ring.adapter jetty] |
5 (laserkard buy-temp faq) | 5 [laserkard buy-temp faq]) |
6 ) | |
6 | 7 |
7 )) | 8 (defroutes laserkard |
8 | |
9 (defroutes example | |
10 (GET "/index.clj" [] "<h1> hello, connie, good to meet you</h1>") | 9 (GET "/index.clj" [] "<h1> hello, connie, good to meet you</h1>") |
11 (GET "/buy-temp.clj" [] (buy-gen)) | 10 (GET "/buy-temp.clj" [] (buy-gen)) |
12 (GET "/faq.clj" [] (faq)) | 11 (GET "/faq.clj" [] (faq)) |
13 ) | 12 ) |
14 | 13 |
14 (defn serve [] | |
15 (future | |
16 (run-jetty (var laserkard.server/laserkard) {:port 9000 :host "localhost"}))) | |
15 | 17 |
16 | 18 |
17 (defserver laserkard-server | 19 ;(defserver laserkard-server |
18 {:port 9000 :host "localhost"} | 20 ; {:port 9000 :host "localhost"} |
19 "/*" (servlet example)) | 21 ; "/*" (servlet example)) |
20 | 22 |
21 | 23 |
22 | 24 |
23 | 25 |
24 | 26 |