import "reflect-metadata"; import { NestFactory } from "@nestjs/core"; import type { NestFastifyApplication } from "@nestjs/platform-fastify"; import { FastifyAdapter } from "@nestjs/platform-fastify"; import { AppModule, configureApp } from "./app.module.js"; export async function createApp(): Promise { const app = await NestFactory.create(AppModule, new FastifyAdapter()); configureApp(app); return app; } if (process.env.NODE_ENV !== "test") { const app = await createApp(); await app.listen({ port: Number(process.env.API_PORT ?? 3001), host: "0.0.0.0" }); }