toip.tools

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/eventlogView source
TypeScriptImport
import { witnessHttpHandler } from "@toip-tools/eventlog";

Declaration

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

Parameters

wrequired
Witness

Returns

(req: Request) => Promise<Response>