function · Browser and Node

# witnessHttpHandler

Routes, relative to wherever the handler is mounted: POST submit (CESR text) → SubmitResult; POST receipts (CESR text) → {}; GET log/:id?from&to → CESR text; GET head/:id → CESR text of the witness's receipt (404 if none); GET evidence?logId → evidence as JSON.

`@toip-tools/eventlog` · [View source](https://github.com/yourbuddyconner/toip-tools/blob/main/packages/eventlog/src/http.ts#L16)

Import:

```ts
import { witnessHttpHandler } from "@toip-tools/eventlog";
```

## Declaration

Signature:

```ts
witnessHttpHandler(w: Witness): (req: Request) => Promise<Response>;
```

### Parameters

- **`w` (required)**: `Witness`

### Returns

`(req: Request) => Promise<Response>`

[Usage guide](https://toip.tools/toolkit/eventlog/#usage) · [Error handling](https://toip.tools/toolkit/eventlog/#errors) · [All exports](https://toip.tools/toolkit/eventlog/api/)

---

This is the Markdown version of https://toip.tools/toolkit/eventlog/api/witnessHttpHandler/. An index of the documentation for AI assistants is at https://toip.tools/llms.txt.
