@anzaui/engine - v0.6.0
    Preparing search index...

    Module @anzaui/engine/adapters/fastify

    Fastify helpers. The reply is typed as any, so this module does not depend on Fastify. There is no SSE helper: write sseEvent(envelope) to the raw response yourself.

    import Fastify from 'fastify';
    import { Fragment, Page, Setup } from '@anzaui/engine';
    import { sendHtml, sendJson } from '@anzaui/engine/adapters/fastify';

    const fastify = Fastify();
    const engine = await new Setup({ root: './templates' }).run();

    fastify.get('/', async (request, reply) => sendHtml(reply, await new Page('/', { title: 'Fastify' }).run(engine)));
    fastify.get('/card/:id', async (request, reply) => {
    const { id } = request.params as { id: string };
    return sendJson(reply, await new Fragment('feed/card.html', 'feed', { id }).run(engine));
    });

    await fastify.listen({ port: 3000 });
    sendHtml
    sendJson