Skip to content

Commit

Permalink
Merge pull request #6 from Nauxscript/main
Browse files Browse the repository at this point in the history
feat: integrate swagger
  • Loading branch information
hildxd authored Jan 16, 2024
2 parents 7d4b3c1 + 577b900 commit 980153b
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 4 deletions.
1 change: 1 addition & 0 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@nestjs/common": "^10.0.0",
"@nestjs/core": "^10.0.0",
"@nestjs/platform-express": "^10.0.0",
"@nestjs/swagger": "^7.1.17",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.8.1",
"start": "^5.1.0"
Expand Down
14 changes: 13 additions & 1 deletion apps/api/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';

async function bootstrap() {
const app = await NestFactory.create(AppModule);
await app.listen(3000);

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);
console.log('done');
await app.listen(3001);
}

bootstrap();
59 changes: 56 additions & 3 deletions pnpm-lock.yaml

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

0 comments on commit 980153b

Please sign in to comment.