Files
core/bench/servers/nestjs-fastify.ts
T
chrnx 3a4cd5a7ce
CI / build (pull_request) Successful in 59s
test(bench): reach bench servers cross-host + add scale and Bun/Deno servers
Fastify and the Nest adapters bound 127.0.0.1, unreachable from a separate load generator; bind 0.0.0.0 so two-machine benchmarks work.

Adds scale-{green-tea,express} (step-vs-middleware depth sweeps that surfaced the O(n^2)) and green-tea-{bun,deno} (the same app served via serveBun/serveDeno, to benchmark across runtimes).

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-17 19:05:52 -05:00

14 lines
630 B
TypeScript

import 'reflect-metadata';
import { NestFactory } from '@nestjs/core';
import { FastifyAdapter, NestFastifyApplication } from '@nestjs/platform-fastify';
import { BenchModule } from './_nest-shared';
async function main() {
const adapter = new FastifyAdapter({ logger: false, keepAliveTimeout: 5000 }); // parity via constructor
const app = await NestFactory.create<NestFastifyApplication>(BenchModule, adapter, { logger: false });
await app.listen(0, '0.0.0.0');
const server = app.getHttpServer();
console.log(`READY ${(server.address() as any).port}`);
}
main().catch((e) => { console.error(e); process.exit(1); });