Skip to content

Commit

Permalink
chore: 운영 환경 스웨거 제외
Browse files Browse the repository at this point in the history
  • Loading branch information
tfer2442 committed Sep 8, 2024
1 parent e74e8a6 commit 4b3a78e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
8 changes: 1 addition & 7 deletions src/main/java/com/haedal/haedalweb/config/SwaggerConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,12 @@
import io.swagger.v3.oas.models.security.SecurityRequirement;
import io.swagger.v3.oas.models.security.SecurityScheme;
import org.springdoc.core.customizers.OperationCustomizer;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.http.HttpHeaders;
import org.springframework.validation.FieldError;
import org.springframework.web.method.HandlerMethod;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
Expand All @@ -47,14 +45,10 @@
@Configuration
public class SwaggerConfig {
private static final String BEARER_TOKEN_PREFIX = "Bearer";
private static boolean swaggerEnabled = false;

@Bean
@Profile("!prod")
public OpenAPI openAPI() {
if (!swaggerEnabled) {
return null;
}

String accessToken = "Access Token (Bearer)";

SecurityRequirement securityRequirement = new SecurityRequirement()
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
spring.profiles.include=db, jwt, aws
spring.profiles.include=db, jwt, aws
spring.profiles.active=prod

0 comments on commit 4b3a78e

Please sign in to comment.