Skip to content

Commit

Permalink
Update to make /api redirect to springdoc.swagger-ui.path
Browse files Browse the repository at this point in the history
  • Loading branch information
haynescd committed Jan 10, 2024
1 parent 9b3531f commit b0e1808
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/org/cbioportal/WebAppConfig.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.cbioportal;

import org.cbioportal.web.util.InvolvedCancerStudyExtractorInterceptor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerInterceptor;
Expand All @@ -16,6 +17,9 @@
public class WebAppConfig implements WebMvcConfigurer {

private static final String SINGLE_PAGE_APP_ROOT = "forward:/";

@Value("${springdoc.swagger-ui.path:/swagger-ui.html}")
private String swaggerRedirectUrl;

@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
Expand All @@ -26,7 +30,7 @@ public void addResourceHandlers(ResourceHandlerRegistry registry) {

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


// Redirects for single page app
Expand Down

0 comments on commit b0e1808

Please sign in to comment.