Skip to content

Commit

Permalink
attach: swagger
Browse files Browse the repository at this point in the history
  • Loading branch information
siwonpada committed Mar 7, 2024
1 parent cdfabe4 commit e1295bc
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 3 deletions.
66 changes: 63 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@nestjs/config": "^3.2.0",
"@nestjs/core": "^10.0.0",
"@nestjs/platform-express": "^10.0.0",
"@nestjs/swagger": "^7.3.0",
"@prisma/client": "^5.10.2",
"reflect-metadata": "^0.2.0",
"rxjs": "^7.8.1"
Expand Down
10 changes: 10 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';

async function bootstrap() {
const app = await NestFactory.create(AppModule);
// swagger config
const config = new DocumentBuilder()
.setTitle('Vapor-auth API')
.setDescription('The Vapor-auth API description')
.setVersion('1.0')
.build();
const document = SwaggerModule.createDocument(app, config);
SwaggerModule.setup('api', app, document);
// start server
await app.listen(3000);
}
bootstrap();

0 comments on commit e1295bc

Please sign in to comment.