Skip to content

Commit

Permalink
fix: swagger production 환경에서는 비활성화
Browse files Browse the repository at this point in the history
  • Loading branch information
summersummerwhy committed Dec 5, 2024
1 parent 4804ab2 commit e9fffbf
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions apps/backend/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@ async function bootstrap() {
app.setGlobalPrefix('api');
app.use(express.urlencoded({ extended: true }));

const config = new DocumentBuilder()
.setTitle('OctoDocs')
.setDescription('OctoDocs API 명세서')
.build();
// Swagger 설정 (production 환경에서는 비활성화)
if (process.env.NODE_ENV !== 'production') {
const config = new DocumentBuilder()
.setTitle('OctoDocs')
.setDescription('OctoDocs API 명세서')
.build();

const documentFactory = () => SwaggerModule.createDocument(app, config);
SwaggerModule.setup('api', app, documentFactory);
}

const documentFactory = () => SwaggerModule.createDocument(app, config);
SwaggerModule.setup('api', app, documentFactory);
app.enableCors({
origin:
process.env.NODE_ENV === 'production'
Expand Down

0 comments on commit e9fffbf

Please sign in to comment.