import { NestFactory } from '@nestjs/core'; import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; import { RedocModule, RedocOptions } from '../src'; import { AppModule } from './app.module'; async function bootstrap() { const app = await NestFactory.create(AppModule); const options = new DocumentBuilder() .setTitle('Cats example') .setDescription('The cats API description') .setVersion('1.0') .addTag('cats') .addBasicAuth() .addBearerAuth() .addOAuth2() .addApiKey() .addCookieAuth() .addSecurityRequirements('bearer') .build(); const document = SwaggerModule.createDocument(app, options); const redocOptions: RedocOptions = { title: 'Redoc Module', logo: { url: 'https://redocly.github.io/redoc/petstore-logo.png', backgroundColor: '#F0F0F0', altText: 'PetStore Logo', }, sortPropsAlphabetically: true, hideDownloadButton: false, hideHostname: false, noAutoAuth: true, pathInMiddlePanel: true, auth: { enabled: true, user: 'admin', password: '123', }, tagGroups: [ { name: 'Core resources', tags: ['cats'], }, ], }; await RedocModule.setup('docs', app, document, redocOptions); await app.listen(8000); } bootstrap();