Clojure ring adapter for
com.sun.net.httpserver.HttpServer
which is included in the JDK.
The main motivation for this is to support starting a small HTTP server inside an application which itself isn't necessary primarily a web app, while avoiding adding any new dependencies on the classpath (apart from ring-core). It could also be used for tests.
HTTP only for now. Untested.
(require 'ring-http-exchange.core)
(ring-http-exchange.core/run-http-server
(fn [request]
{:status 200
:headers {"Content-Type" "text/plain"}
:body "Hello World"}
{:port 8080})
The options are a subset of the ones support by ring-jetty-adapter. See docstring for details.
Copyright © 2017 Håkan Råberg
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.