diff --git a/src/main/java/org/cbioportal/WebAppConfig.java b/src/main/java/org/cbioportal/WebAppConfig.java index 8e011e5ed93..67033e56b07 100644 --- a/src/main/java/org/cbioportal/WebAppConfig.java +++ b/src/main/java/org/cbioportal/WebAppConfig.java @@ -1,5 +1,7 @@ package org.cbioportal; +import java.util.List; + import org.cbioportal.web.util.InvolvedCancerStudyExtractorInterceptor; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; @@ -33,9 +35,32 @@ public void addResourceHandlers(ResourceHandlerRegistry registry) { public void addViewControllers(ViewControllerRegistry registry) { registry.addRedirectViewController("/api", swaggerRedirectUrl); registry.addRedirectViewController("/installations", "https://installationmap.netlify.app/"); + registry.addRedirectViewController("/tutorials", "https://docs.cbioportal.org/user-guide/overview/#tutorial-slides"); + registry.addRedirectViewController("/oql", "https://docs.cbioportal.org/user-guide/oql/"); + + List endpoints = List.of( + "/results/*", + "/results**", + "/patient/*", + "/patient**", + "/study/*", + "/study", + "/mutation_mapper/*", + "/mutation_mapper", + "/index.do/*", + "/case.do/*", + "/loading/*", + "/comparison", + "/comparison/*", + "/restore", + "/index.do**", + "/oncoprinter**", + "/encodedRedirect", + "/datasets**", + "/ln**" + ); - // Redirects anything that doesn't start with /api or /proxy to the Javascript frontend - registry.addViewController("/{path:^(?!api|proxy$).*$}").setViewName(SINGLE_PAGE_APP_ROOT); + endpoints.forEach( route -> registry.addViewController(route).setViewName(SINGLE_PAGE_APP_ROOT)); } @Bean