Created
August 1, 2023 13:13
-
-
Save adtennant/f36bcaa491068abcd47bd735b22c051b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NestFactory } from '@nestjs/core'; | |
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger'; | |
import { AppModule } from './app.module'; | |
async function bootstrap() { | |
const app = await NestFactory.create(AppModule); | |
const config = new DocumentBuilder() | |
.setTitle('Cats example') | |
.setDescription('The cats API description') | |
.setVersion('1.0') | |
.addTag('cats') | |
.build(); | |
const document = SwaggerModule.createDocument(app, config); | |
SwaggerModule.setup('api', app, document, { | |
patchDocumentOnRequest: (reqw, res, document) => { | |
console.log("patchDocumentOnRequest"); | |
return document; | |
} | |
}); | |
await app.listen(3000); | |
} | |
bootstrap(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment