Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to make /api redirect to springdoc.swagger-ui.path #10533

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading