import { NestFactory } from '@nestjs/core'; import { NestExpressApplication } from '@nestjs/platform-express'; import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; import { join } from 'path'; import { AppModule } from './app.module'; async function bootstrap() { const app = await NestFactory.create(AppModule); const config = new DocumentBuilder() .addBearerAuth() .setTitle('Documentacion') .setDescription('des') .setVersion('1.0') .build(); const document = SwaggerModule.createDocument(app, config); SwaggerModule.setup('api', app, document); app.useStaticAssets(join(__dirname, '..', 'public'), { prefix: '/public/', }); app.enableCors(); await app.listen(AppModule.port); } bootstrap();