Liking cljdoc? Tell your friends :D

openadr3.vtn.middleware

Ring middleware: context path stripping, JSON response, and request logging.

Ring middleware: context path stripping, JSON response, and request logging.
raw docstring

wrap-context-pathclj

(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
sourceraw docstring

wrap-json-responseclj

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

  • Encodes map/vector bodies to JSON strings
  • Sets Content-Type: application/json on all JSON responses
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
sourceraw docstring

wrap-request-loggingclj

(wrap-request-logging handler)

Log HTTP requests as structured mulog events with timing.

Log HTTP requests as structured mulog events with timing.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close