@SpringBootApplication
public class MyApp {
public static void main(String[] args) {
SpringApplication.run(MyApp.class, args);
}
@Bean
RouterFunction<ServerResponse> routerFunction() {
return route(GET("/swagger"), req ->
ServerResponse.temporaryRedirect(URI.create("swagger-ui.html")).build());
}
}
위와 같이 빈으로 등록해주면, localhost:8080/swagger로 접속하였을때
localhost:8080/swagger-ui.html로 리다이렉트 해줍니다.
'Spring Boot' 카테고리의 다른 글
Spring Actuator와 Swagger가 서로 충돌할때 (0) | 2023.09.19 |
---|---|
[Spring] REST API로 파일 보내기 (0) | 2023.08.10 |
[Spring] 타임리프에서 Spring Service 호출하기 (0) | 2023.08.08 |
[Spring] Lombok을 이용한 간단한 의존성 생성자 주입 (0) | 2023.08.01 |
[Spring] List를 Page로 변환하기 (0) | 2023.07.12 |