Permalink
Newer
100644
17 lines (13 sloc)
440 Bytes
|
68e08fb
|
||
| 1 | ; A very simple Ring application. | |
| 2 | ||
|
cbeebac
|
||
| 3 | (ns ring.example.hello-world | |
| 4 | (:use ring.adapter.jetty) | |
|
c68558e
|
||
| 5 | (:import java.util.Date java.text.SimpleDateFormat)) | |
|
68e08fb
|
||
| 6 | ||
| 7 | (defn app | |
| 8 | [req] | |
| 9 | {:status 200 | |
| 10 | :headers {"Content-Type" "text/html"} | |
| 11 | :body (str "<h3>Hello World from Ring</h3>" | |
|
cbeebac
|
||
| 12 | "<p>The current time is " | |
|
f2f4229
|
||
| 13 | (.format (SimpleDateFormat. "HH:mm:ss") (Date.)) | |
| 14 | ".</p>")}) | |
|
68e08fb
|
||
| 15 | ||
|
cbeebac
|
||
| 16 | (run-jetty app {:port 8080}) |