Tanguv0.35.0
Web & HTTP7 exports
Raw Markdown

/web/app/handlers

Composable HTTP request handlers: chain-handlers, route-map, route-fs, route-graph, handle-html, handle-css, handle-not-found.

(use /web/app/handlers)

Functions & symbols#

chain-handlers#

function
(chain-handlers handlers)

Composes an array of handlers, returning the first non-404 response or falling back to 404.

ParameterTypeOptionalDescription
handlersAnyrequired—
Returns:Any

handle-css#

function
(handle-css path ...rest)

Serves a `.css.tan` stylesheet with in-memory caching, dev mtime invalidation, and `?reload` / `?nocache` cache busting.

ParameterTypeOptionalDescription
pathAnyrequired—
restAnyoptional—
Returns:Any

handle-html#

function
(handle-html path ...rest)

Serves a `.html.tan` template or `(Func req ...)` handler with optional static HTML caching and dev mtime invalidation.

ParameterTypeOptionalDescription
pathAnyrequired—
restAnyoptional—
Returns:Any

handle-not-found#

function
(handle-not-found _req)

Default `404 Not Found` handler.

ParameterTypeOptionalDescription
_reqAnyrequired—
Returns:Any

route-fs#

function
(route-fs base-path ...rest)

Routes filesystem `.html.tan` and `.css.tan` resources under `base-path`.

ParameterTypeOptionalDescription
base-pathAnyrequired—
restAnyoptional—
Returns:Any

route-graph#

function
(route-graph graph)

Wraps an `App-Graph` into a compiled HTTP route handler via `route-map`.

ParameterTypeOptionalDescription
graphAnyrequired—
Returns:Any

route-map#

function
(route-map routes)

Routes requests against a compiled route map trie.

ParameterTypeOptionalDescription
routesAnyrequired—
Returns:Any

Related modules