import "reflect-metadata"; import { NestFactory } from "@nestjs/core"; import { FastifyAdapter, type NestFastifyApplication } from "@nestjs/platform-fastify"; import { AppModule } from "./app.module.js"; async function bootstrap() { const app = await NestFactory.create(AppModule, new FastifyAdapter(), { logger: ["error", "warn", "log"], }); app.setGlobalPrefix("api"); app.enableCors({ origin: true }); const port = Number(process.env.API_PORT ?? 3001); await app.listen(port, "0.0.0.0"); console.log(`[api] listening on http://localhost:${port}/api`); } bootstrap().catch((err) => { console.error(err); process.exit(1); });