Skip to content

Commit

Permalink
feat: add swagger page to nestjs
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-thomas committed Sep 5, 2023
1 parent 026a8b0 commit 3e8f9d5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion backend/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
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);
await app.listen(3000);

const config = new DocumentBuilder().build();
const document = SwaggerModule.createDocument(app, config);
SwaggerModule.setup('/swagger', app, document);

await app.listen(9000);
}
bootstrap();

0 comments on commit 3e8f9d5

Please sign in to comment.