Skip to content

Instantly share code, notes, and snippets.

@adtennant
Created August 1, 2023 13:13
Show Gist options
  • Save adtennant/f36bcaa491068abcd47bd735b22c051b to your computer and use it in GitHub Desktop.
Save adtennant/f36bcaa491068abcd47bd735b22c051b to your computer and use it in GitHub Desktop.
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