import { NestFactory } from '@nestjs/core'; import { FastifyAdapter } from '@nestjs/platform-fastify'; import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger'; import { AppModule } from './app.module'; import { CrudConfigService } from '@nestjsx/crud'; CrudConfigService.load({ query: { limit: 100, maxLimit: 100, alwaysPaginate: true, }, }); async function bootstrap() { const app = await NestFactory.create(AppModule, new FastifyAdapter()); app.enableCors(); if (!process.env.NO_DOCS) { const options = new DocumentBuilder() .setTitle('QiVisor') .setDescription('QiVisor API') .setVersion('1.0') .addBearerAuth() .build(); const document = SwaggerModule.createDocument(app, options); SwaggerModule.setup('docs', app, document); } await app.listen(process.env.PORT || 3000, '0.0.0.0'); } bootstrap();