File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -17,13 +17,17 @@ async function bootstrap() {
1717 app . setGlobalPrefix ( 'api' ) ;
1818 app . use ( express . urlencoded ( { extended : true } ) ) ;
1919
20- const config = new DocumentBuilder ( )
21- . setTitle ( 'OctoDocs' )
22- . setDescription ( 'OctoDocs API 명세서' )
23- . build ( ) ;
20+ // Swagger 설정 (production 환경에서는 비활성화)
21+ if ( process . env . NODE_ENV !== 'production' ) {
22+ const config = new DocumentBuilder ( )
23+ . setTitle ( 'OctoDocs' )
24+ . setDescription ( 'OctoDocs API 명세서' )
25+ . build ( ) ;
26+
27+ const documentFactory = ( ) => SwaggerModule . createDocument ( app , config ) ;
28+ SwaggerModule . setup ( 'api' , app , documentFactory ) ;
29+ }
2430
25- const documentFactory = ( ) => SwaggerModule . createDocument ( app , config ) ;
26- SwaggerModule . setup ( 'api' , app , documentFactory ) ;
2731 app . enableCors ( {
2832 origin :
2933 process . env . NODE_ENV === 'production'
You can’t perform that action at this time.
0 commit comments