Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(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