Skip to content
This repository has been archived by the owner on Apr 30, 2020. It is now read-only.

hraberg/ring-http-exchange

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ring-http-exchange

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.

Usage

(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.

License

Copyright © 2017 Håkan Råberg

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

About

Ring adapter for com.sun.net.httpserver. Active fork: https://github.com/pepijn/ring-http-exchange

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published