Skip to content

Instantly share code, notes, and snippets.

@MrCube42

MrCube42/main.ts Secret

Created March 28, 2020 12:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MrCube42/8dffda0dbae4ffe545b4ff497018ca5e to your computer and use it in GitHub Desktop.
Save MrCube42/8dffda0dbae4ffe545b4ff497018ca5e to your computer and use it in GitHub Desktop.
In der main.ts initialisieren wir die automatische Dokumentation mit Hilfe von Swagger.
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
// ...
async function bootstrap() {
// ...
const options = new DocumentBuilder()
.setTitle('ngCompanion Backend')
.setDescription('The ngCompanion API description.')
.setVersion('1.0')
.addTag('companions')
.build();
const document = SwaggerModule.createDocument(app, options);
SwaggerModule.setup('api', app, document);
// ...
}
bootstrap();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment