Docs → Fastify Integration
🚀
Fastify Integration
Register plugin for request/response handling
Fastify users can register the `toon` plugin to parse TOON bodies and send TOON responses.
Fastify Plugin
import Fastify from "fastify"; import { toon } from "toonkit2/fastify"; const app = Fastify(); await app.register(toon); app.post("/devices", async (req, reply) => { const data = req.toon(); reply.toon({ ok: true, received: data }); });