API reference

fast-twitch.middlewares.defaults

Complete generated reference for fast-twitch.middlewares.defaults

Choose a configuration

(ns application.defaults
  (:require [fast-twitch.middlewares.defaults :as defaults]))

(defn handler [_]
  {:status 200 :headers {"content-type" "text/plain"} :body "Hello"})

(def app (defaults/wrap-defaults handler defaults/site-defaults))

wrap-defaults takes [handler options]. api-defaults and site-defaults are ordinary option maps, not functions or runtime singletons. The defaults table lists enabled features and execution constraints. The todo project shows custom settings around an authenticated application.

API defaults parse URL-encoded/query parameters and keywordize them; site defaults add multipart/nested parameters, cookies, sessions, flash and anti-forgery. Neither map implies JSON body decoding, durable session storage, active rate limiting or proxy trust. Request-control and deployment/security settings must be explicitly selected. HEAD wrapping is included by the current response-default chain.

Change a nested setting with assoc-in on the selected map, for example (assoc-in defaults/api-defaults [:requests :timeout] {:timeout-ms 5000}). Wrapper-specific options remain wrapper-specific; see the full inventory.

Upstream function reference

Preconfigured middleware bundles for common API and site-oriented applications.

api-defaults

Default middleware options for API-oriented applications. Source

site-defaults

Default middleware options for browser-facing site applications. Source

wrap-defaults

(wrap-defaults handler options)

Function.

Applies the configured default middleware bundles to a handler. Source


Source revision a4eb73f96836d034c7a24fe09dc7d51e4c581f64

Built with Fast-Twitch · Integrant · Datastar

Search documentation

Search pages and API symbols

Start hereWelcome to Fast-TwitchRing HTTP applications and configured native clients and transports in ClojureScript.Start hereGetting startedCompile and run your first Fast-Twitch server.Core conceptsRequest & responseUnderstand the maps at the center of a Fast-Twitch application.Core conceptsRoutingMatch URL patterns and compose handlers.Core conceptsMiddlewareWrap handlers with focused request and response behavior.GuidesHTML & IntegrantCompose a UI system with Integrant and render Hiccup.