Variable: fastifyKitaHtml

Estimated reading time: less than 1 minute
const fastifyKitaHtml: FastifyPluginCallback<NonNullable<Partial<FastifyKitaHtmlOptions>>>

The @kitajs/fastify-html-plugin Fastify plugin.

Example

import Fastify from 'fastify';
import { fastifyKitaHtml } from '@kitajs/fastify-html-plugin';

const app = Fastify();

// Register the plugin
app.register(fastifyKitaHtml, { autoDoctype: true });

app.get('/', (req, reply) =>
  reply.html(
    <html lang="en">
      <body>
        <h1>Hello, world!</h1>
      </body>
    </html>
  )
);

app.listen({ port: 3000 });