import{NestFactory}from'@nestjs/core';import{SwaggerModule,DocumentBuilder}from'@nestjs/swagger';import{AppModule}from'./app.module';import{CatsModule}from'./cats/cats.module';import{DogsModule}from'./dogs/dogs.module';asyncfunctionbootstrap(){constapp=awaitNestFactory.create(AppModule);/** * createDocument(application, configurationOptions, extraOptions); * * createDocument method takes an optional 3rd argument "extraOptions" * which is an object with "include" property where you can pass an Array * of Modules that you want to include in that Swagger Specification * E.g: CatsModule and DogsModule will have two separate Swagger Specifications which * will be exposed on two different SwaggerUI with two different endpoints. */constoptions=newDocumentBuilder().setTitle('Cats example').setDescription('The cats API description').setVersion('1.0').addTag('cats').build();constcatDocument=SwaggerModule.createDocument(app,options,{include:[CatsModule],});SwaggerModule.setup('api/cats',app,catDocument);constsecondOptions=newDocumentBuilder().setTitle('Dogs example').setDescription('The dogs API description').setVersion('1.0').addTag('dogs').build();constdogDocument=SwaggerModule.createDocument(app,secondOptions,{include:[DogsModule],});SwaggerModule.setup('api/dogs',app,dogDocument);awaitapp.listen(3000);}bootstrap();