티스토리 뷰
공부
[Spring Boot] How to fully disable swagger-ui in spring-boot?(/swagger-ui.html should return 404)
승가비 2022. 1. 12. 13:38728x90
@Profile(value = {"swagger"})
@Configuration
@EnableSwagger2
public class SwaggerConfiguration {
...
}
import org.apache.commons.lang3.StringUtils;
import org.springframework.context.annotation.Profile;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@Profile("!local")
@Controller
public class SwaggerUiController {
@GetMapping(value = "swagger-ui.html")
public ResponseEntity disable() {
return new ResponseEntity<>(StringUtils.EMPTY, HttpStatus.NOT_FOUND);
}
}
728x90
'공부' 카테고리의 다른 글
[Java] StringEscapeUtils.escapeJava(str); (0) | 2022.01.14 |
---|---|
[Oracle] char, varchar, varchar2 (0) | 2022.01.14 |
[Mac] MySQL (brew install mysql; mysql.server start) (0) | 2022.01.10 |
[Java] MySQL if check exists table (0) | 2022.01.10 |
[Java] MySQL select value (0) | 2022.01.10 |
댓글
250x250
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- 연애학개론
- 유투브
- Kluge
- 팔로워 수 세기
- 테슬라 크레딧 사용
- 테슬라 리퍼럴 코드 혜택
- 테슬라
- 김달
- 할인
- 테슬라 레퍼럴 적용 확인
- COUNT
- 테슬라 리퍼럴 코드
- Bot
- 테슬라 추천
- 테슬라 리퍼럴 코드 생성
- 메디파크 내과 전문의 의학박사 김영수
- 모델 Y 레퍼럴
- 책그림
- 클루지
- 어떻게 능력을 보여줄 것인가?
- 레퍼럴
- 개리마커스
- 테슬라 레퍼럴 코드 확인
- follower
- 테슬라 레퍼럴
- 인스타그램
- 모델y
- wlw
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
글 보관함