feat(bench): add NestJS (platform-express + platform-fastify) servers
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
7 files changed
+737
-1
No files matched your search
@@ -0,0 +1,13 @@
|
||||
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, '127.0.0.1');
|
||||
const server = app.getHttpServer();
|
||||
console.log(`READY ${(server.address() as any).port}`);
|
||||
}
|
||||
main().catch((e) => { console.error(e); process.exit(1); });
|
||||
Reference in new issue
Block a user