Class FrontController
- java.lang.Object
-
- nl.b3p.tailormap.api.configuration.base.FrontController
-
@Controller public class FrontController extends Object
Front controller which forwards requests to URLs created by the Angular routing module to the proper viewer or admin index.html of the Angular bundle, for example when the user refreshes the page. Unfortunately, a proper front controller would first check if the file which the requested URL maps to exists and only return the index.html file if it doesn't. That is quite complicated to do in Spring Boot so as a poor-mans alternative we explicitly match the specific router URLs navigated to by the Angular frontends which don't map to files from the bundle.It could happen that a frontend developer adds a route and forgets to update this front controller, and it is only noticed later when someone presses F5 and gets a 404.
-
-
Constructor Summary
Constructors Constructor Description FrontController(ConfigurationRepository configurationRepository, ApplicationRepository applicationRepository)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringappIndex(javax.servlet.http.HttpServletRequest request)StringlocalePrefixedAppIndex(String locale, javax.servlet.http.HttpServletRequest request)StringswaggerUiWelcomePage()
-
-
-
Constructor Detail
-
FrontController
public FrontController(@Lazy ConfigurationRepository configurationRepository, @Lazy ApplicationRepository applicationRepository)
-
-
Method Detail
-
appIndex
@GetMapping({"/","/login","/app","/app/","/app/**","/service/**","/admin/**","/ext/**"}) public String appIndex(javax.servlet.http.HttpServletRequest request)
-
localePrefixedAppIndex
@GetMapping({"/{locale}/","/{locale}/login","/{locale:^(?!api)[a-zA-Z-]+}/app/**","/{locale:^(?!api)[a-zA-Z-]+}/service/**","/{locale:^(?!api)[a-zA-Z-]+}/admin/**","/{locale:^(?!api)[a-zA-Z-]+}/ext/**"}) public String localePrefixedAppIndex(@PathVariable("locale") String locale, javax.servlet.http.HttpServletRequest request)
-
swaggerUiWelcomePage
@GetMapping({"/swagger-ui","/swagger-ui/"}) public String swaggerUiWelcomePage()
-
-