@axiomify/http
v5.0.0
Published
[](https://npmjs.com/package/@axiomify/http)
Readme
@axiomify/http
Node.js native HTTP adapter for Axiomify. Zero external dependencies. 32,841 req/s single-core, 57,200 req/s at 2 workers (160% scaling, SO_REUSEPORT).
Install
npm install @axiomify/http @axiomify/core zodQuick example
import { Axiomify } from '@axiomify/core';
import { HttpAdapter } from '@axiomify/http';
const app = new Axiomify();
app.enableRequestId();
app.route({
method: 'GET',
path: '/ping',
handler: async (_req, res) => res.send({ pong: true }),
});
// Single process
const server = new HttpAdapter(app).listen(3000, () => console.log('Ready'));
// Multi-core
const adapter = new HttpAdapter(app, { workers: 4 });
adapter.listenClustered(3000, {
onPrimary: (pids) => console.log('Workers:', pids),
});