add swagger docs

This commit is contained in:
2026-05-12 14:42:36 +03:30
parent 8056503078
commit 35e436ae9e
3 changed files with 64 additions and 2 deletions
+15
View File
@@ -1,9 +1,24 @@
import 'reflect-metadata';
import { NestFactory } from '@nestjs/core';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
import { AppModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
const swaggerConfig = new DocumentBuilder()
.setTitle('Montime API')
.setDescription('Local services super app API')
.setVersion('1.0')
.addBearerAuth()
.build();
const swaggerDocument = SwaggerModule.createDocument(app, swaggerConfig);
SwaggerModule.setup('docs', app, swaggerDocument, {
swaggerOptions: {
persistAuthorization: true,
},
});
await app.listen(process.env.PORT ?? 3000);
}
bootstrap();