# Module /web/app/handlers

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

```tangu
(use /web/app/handlers)
```

## Functions & symbols

### chain-handlers

`(chain-handlers handlers)`

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

| Parameter | Type | Optional | Description |
| :--- | :--- | :--- | :--- |
| `handlers` | `Any` | no | — |

### handle-css

`(handle-css path ...rest)`

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

| Parameter | Type | Optional | Description |
| :--- | :--- | :--- | :--- |
| `path` | `Any` | no | — |
| `rest` | `Any` | yes | — |

### handle-html

`(handle-html path ...rest)`

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

| Parameter | Type | Optional | Description |
| :--- | :--- | :--- | :--- |
| `path` | `Any` | no | — |
| `rest` | `Any` | yes | — |

### handle-not-found

`(handle-not-found _req)`

Default `404 Not Found` handler.

| Parameter | Type | Optional | Description |
| :--- | :--- | :--- | :--- |
| `_req` | `Any` | no | — |

### route-fs

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

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

| Parameter | Type | Optional | Description |
| :--- | :--- | :--- | :--- |
| `base-path` | `Any` | no | — |
| `rest` | `Any` | yes | — |

### route-graph

`(route-graph graph)`

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

| Parameter | Type | Optional | Description |
| :--- | :--- | :--- | :--- |
| `graph` | `Any` | no | — |

### route-map

`(route-map routes)`

Routes requests against a compiled route map trie.

| Parameter | Type | Optional | Description |
| :--- | :--- | :--- | :--- |
| `routes` | `Any` | no | — |
