CI / build (pull_request) Successful in 59s
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>
18 lines
684 B
TypeScript
18 lines
684 B
TypeScript
import 'reflect-metadata';
|
|
import { NestFactory } from '@nestjs/core';
|
|
import { ExpressAdapter } from '@nestjs/platform-express';
|
|
import express from 'express';
|
|
import { BenchModule } from './_nest-shared';
|
|
|
|
async function main() {
|
|
const inst = express();
|
|
inst.disable('x-powered-by');
|
|
inst.set('etag', false);
|
|
const app = await NestFactory.create(BenchModule, new ExpressAdapter(inst), { logger: false });
|
|
await app.listen(0, '0.0.0.0');
|
|
const server = app.getHttpServer();
|
|
server.keepAliveTimeout = 5000; // parity (works on Node http.Server after listen)
|
|
console.log(`READY ${server.address().port}`);
|
|
}
|
|
main().catch((e) => { console.error(e); process.exit(1); });
|