Class FrontController
java.lang.Object
org.tailormap.api.configuration.base.FrontController
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
ConstructorDescriptionFrontController
(ConfigurationRepository configurationRepository, ApplicationRepository applicationRepository) -
Method Summary
Modifier and TypeMethodDescriptionappIndex
(jakarta.servlet.http.HttpServletRequest request) localePrefixedAppIndex
(String locale, jakarta.servlet.http.HttpServletRequest request)
-
Constructor Details
-
FrontController
public FrontController(@Lazy ConfigurationRepository configurationRepository, @Lazy ApplicationRepository applicationRepository)
-
-
Method Details
-
appIndex
@GetMapping({"/","/login","/app","/app/","/app/**","/service/**","/admin/**","/ext/**"}) public String appIndex(jakarta.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, jakarta.servlet.http.HttpServletRequest request) -
swaggerUiWelcomePage
-