-
-
Notifications
You must be signed in to change notification settings - Fork 104
Expand file tree
/
Copy pathmain.ts
More file actions
23 lines (19 loc) · 748 Bytes
/
main.ts
File metadata and controls
23 lines (19 loc) · 748 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
import { cleanupOpenApiDoc } from 'nestjs-zod';
import { NestExpressApplication } from '@nestjs/platform-express';
async function bootstrap() {
const app = await NestFactory.create<NestExpressApplication>(AppModule);
app.set('query parser', 'extended');
const openApiDoc = SwaggerModule.createDocument(app,
new DocumentBuilder()
.setTitle('Example API')
.setDescription('Example API description')
.setVersion('1.0')
.build()
);
SwaggerModule.setup('api', app, cleanupOpenApiDoc(openApiDoc));
await app.listen(process.env.PORT ?? 3001);
}
bootstrap();