import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { Logger } from 'nestjs-pino';

async function bootstrap() {
  const app = await NestFactory.create(AppModule, { bufferLogs: true });
  app.useLogger(app.get(Logger)); // Enable JSON logger globally
  
  const logger = app.get(Logger);
  
  await app.listen(3001);
  logger.log(`Application is running on: ${await app.getUrl()}`);
}
bootstrap();
