toFastifyHandler
toFastifyHandler(
handler): (request,reply) =>Promise<void>
Wraps a Web-standard handler into a Fastify route handler.
Converts Fastify request/reply to Web Request/Response and streams the SSE response back.
Parameters
Section titled “Parameters”handler
Section titled “handler”(req) => Response
Returns
Section titled “Returns”(request, reply) => Promise<void>
Example
Section titled “Example”import { createHandler, toFastifyHandler } from "agent-express/http"const handler = createHandler(agent)fastify.post("/api/agent", toFastifyHandler(handler))