File tree 2 files changed +16
-0
lines changed
2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { INestApplication } from '@nestjs/common' ;
2
+ import { DocumentBuilder , SwaggerModule } from '@nestjs/swagger' ;
3
+
4
+ export function setupSwagger ( app : INestApplication ) {
5
+ const config = new DocumentBuilder ( )
6
+ . setTitle ( 'Denamu' )
7
+ . setDescription ( '개발자들의 이야기가 자라나는 곳, 데나무🎋 API 명세서' )
8
+ . setVersion ( '1.0' )
9
+ . build ( ) ;
10
+
11
+ const documentFactory = ( ) => SwaggerModule . createDocument ( app , config ) ;
12
+ SwaggerModule . setup ( 'api-docs' , app , documentFactory ) ;
13
+ }
Original file line number Diff line number Diff line change 1
1
import { NestFactory } from '@nestjs/core' ;
2
2
import { AppModule } from './app.module' ;
3
+ import { setupSwagger } from './common/swagger/swagger' ;
3
4
4
5
async function bootstrap ( ) {
5
6
const app = await NestFactory . create ( AppModule ) ;
7
+ setupSwagger ( app ) ;
6
8
await app . listen ( process . env . PORT ?? 3000 ) ;
7
9
}
10
+
8
11
bootstrap ( ) ;
You can’t perform that action at this time.
0 commit comments