No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-21 01:11:24 -03:00
src/br/dev/ourivez Init 2026-08-21 01:11:24 -03:00
test/br/dev/ourivez Init 2026-08-21 01:11:24 -03:00
.gitignore Init 2026-08-21 01:11:24 -03:00
deps.edn Init 2026-08-21 01:11:24 -03:00
README.md Init 2026-08-21 01:11:24 -03:00

Ourivez - jdk.httpserver adapter

Ring adapter for the built-in HTTP server in the JDK (Module jdk.httpserver)

ourivez/jdk.httpserver is a minimalistic wrapper that implements the Ring 2 protocol (the Clojure specification for web applications) on top of the standard JDK HTTP server. It allows you to run Ring handlers directly with a lightweight server, requiring no external dependencies—ideal for development, testing, and microservices. Motivation

  • Zero external dependencies – uses only the JDK; no need for libraries like Jetty or Netty.

  • Lightweight and fast – great for prototyping, health checks, and embedded applications.

  • Fully Ring2-compliant – works seamlessly with any existing Ring middleware.

Installation


br.dev.ourivez/jdk-httpserver {:git/url "..."}

Basic usage clojure

(require '[br.dev.ourivez.jdk-httpserver :as jdk-httpserver])

;; Simple Ring handler
(defn handler 
  [ring-request]
  {:ring.response/status 200
   :ring.response/headers {"Content-Type" "text/plain"}
   :ring.response/body "Hello, world!"})

;; Start server on port 8080 
(def server (jdk-httpserver/run-server handler {:server-port 8080}))

;; Stop the server
(.stop server 0)