@axiomify/fastify
v5.0.0
Published
[](https://npmjs.com/package/@axiomify/fastify)
Readme
@axiomify/fastify
Fastify 5 adapter for Axiomify. 31,334 req/s single-core, 35,200 req/s at 2 workers (165% scaling, SO_REUSEPORT).
Install
npm install @axiomify/fastify @axiomify/core fastify zodQuick example
import { Axiomify } from '@axiomify/core';
import { FastifyAdapter } from '@axiomify/fastify';
const app = new Axiomify();
app.enableRequestId();
app.route({
method: 'GET',
path: '/ping',
handler: async (_req, res) => res.send({ pong: true }),
});
const adapter = new FastifyAdapter(app);
await adapter.listen(3000);
// Multi-core
const clustered = new FastifyAdapter(app, { workers: 4 });
clustered.listenClustered(3000, {
onPrimary: (pids) => console.log('Workers:', pids),
});