Skip to content

Commit

Permalink
FINERACT-1044 Added redirects in swagger-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
thesmallstar authored and vorburger committed Jul 13, 2020
1 parent 6a8a993 commit a440d56
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@EnableWebMvc
Expand All @@ -41,4 +42,10 @@ public void addResourceHandlers(ResourceHandlerRegistry registry) {

registry.addResourceHandler("/swagger-ui/**").addResourceLocations(SWAGGER_RESOURCE_LOCATIONS);
}

@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addRedirectViewController("/swagger-ui", "/swagger-ui/index.html");
registry.addRedirectViewController("/swagger-ui/", "/swagger-ui/index.html");
}
}

0 comments on commit a440d56

Please sign in to comment.