Skip to content

Commit 9464604

Browse files
feat: fastify htmx example
1 parent 7edb3dc commit 9464604

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/fastify-html-plugin/examples/htmx.tsx examples/fastify-htmx.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import fastifyFormbody from '@fastify/formbody';
44
import { Suspense } from '@kitajs/html/suspense';
55
import fastify from 'fastify';
66
import { setTimeout } from 'node:timers/promises';
7-
import { fastifyKitaHtml } from '..';
7+
import { fastifyKitaHtml } from '../packages/fastify-html-plugin/types';
88

99
const app = fastify({ logger: true });
1010

@@ -84,6 +84,9 @@ app.post(
8484
(req, rep) => {
8585
const { username } = req.body as { username: string };
8686
users.push(username);
87+
88+
// Safe is required to avoid xss attacks.
89+
// Use `xss-scan` CLI to automatically check for forgotten `safe` props.
8790
rep.html(<li safe>{username}</li>);
8891
}
8992
);

0 commit comments

Comments
 (0)