Skip to content

Instantly share code, notes, and snippets.

@dsabanin
Created January 22, 2013 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dsabanin/4595299 to your computer and use it in GitHub Desktop.
Save dsabanin/4595299 to your computer and use it in GitHub Desktop.
(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