fast-twitch.middlewares.file-info
Complete generated reference for fast-twitch.middlewares.file-info
Usage and execution boundary
Inspects supported file metadata in a response body map, adds absent size/date headers, then applies content-type and conditional-response helpers. It does not itself read or write a disk file.
(ns application.middleware
(:require [fast-twitch.middlewares.file-info :as middleware]))
(defn handler [_]
{:status 200 :headers {"content-type" "text/plain"} :body "Hello"})
(def app (middleware/wrap-file-info handler))
This defines the Ring handler portion. Adapt app through routing/ft-handler or pass it to server/listen!; startup instructions and a complete walkthrough show the surrounding project.
Settings and defaults
| Setting | Meaning |
|---|---|
:mime-types |
Forwarded to content-type inference |
Wrapper order and all middleware families. The function reference below preserves the upstream signatures and source links; helper functions do not all share the wrapper's arity.
Upstream function reference
Adds metadata-derived headers for file-backed responses and applies cache helpers.
file-info-response
(file-info-response response request)
(file-info-response response request options)
Function.
Adds file-derived headers and cache helpers to a response. Source
wrap-file-info
(wrap-file-info handler)
(wrap-file-info handler options)
Function.
Wraps a handler so file-like responses gain metadata and cache headers. Source