Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 17 lines (13 sloc) 0.44 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
; A very simple Ring application.

(ns ring.example.hello-world
  (:use ring.adapter.jetty)
  (:import java.util.Date java.text.SimpleDateFormat))

(defn app
  [req]
  {:status 200
   :headers {"Content-Type" "text/html"}
   :body (str "<h3>Hello World from Ring</h3>"
                 "<p>The current time is "
                 (.format (SimpleDateFormat. "HH:mm:ss") (Date.))
                 ".</p>")})

(run-jetty app {:port 8080})
Something went wrong with that request. Please try again.