Created
January 22, 2013 15:05
-
-
Save dsabanin/4595299 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use 'ring.adapter.simpleweb) | |
;; Define a basic ring handler | |
(defn handler [req] | |
{:status 200 | |
:headers {"Content-Type" "text/html"} | |
:body "Hello world from SimpleWeb"}) | |
;; Start the server on the specified port, returning a connection | |
(def connection (run-simpleweb handler {:port 8080})) | |
;; To stop the server, invoke .close method on the returned connection. | |
(.close connection) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment