Ring-Serve provides a convenient way of starting a web server for a Ring handler.
The serve
macro:
serve-headless
macro instead.wrap-stacktrace
middleware.swank.core/break
function works correctly inside
your handler.user> (defn handler [request]
{:status 200
:headers {"Content-Type" "text/plain"}
:body "Hello World"})
#'user/handler
user> (use 'ring.util.serve)
nil
user> (serve handler)
Started web server on port 3000
nil
user> (stop-server)
Stopped web server
nil
Include the following dependency in your Leiningen project file:
[ring-serve "0.1.2"]
Can you improve this documentation? These fine people already did:
James Reeves & Donald Clark JacksonEdit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close