Ring middleware: context path stripping, JSON response, and request logging.
Ring middleware: context path stripping, JSON response, and request logging.
(wrap-context-path handler context-path)Strip a context path prefix from the request URI before routing. For example, with context-path "/openadr3/3.1.0": /openadr3/3.1.0/programs → /programs
Strip a context path prefix from the request URI before routing. For example, with context-path "/openadr3/3.1.0": /openadr3/3.1.0/programs → /programs
(wrap-json-response handler)Ensure response bodies are JSON-encoded with proper Content-Type. Legba serializes matched route bodies to JSON strings but does not always set Content-Type. This middleware:
Ensure response bodies are JSON-encoded with proper Content-Type. Legba serializes matched route bodies to JSON strings but does not always set Content-Type. This middleware: - Encodes map/vector bodies to JSON strings - Sets Content-Type: application/json on all JSON responses
(wrap-request-logging handler)Log HTTP requests as structured mulog events with timing.
Log HTTP requests as structured mulog events with timing.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |