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()
-
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()
-
-
-
Method Detail
-
appIndex
@GetMapping({"/","/login","/app/**","/service/**","/admin/**"}) 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/**"}) public String localePrefixedAppIndex(@PathVariable("locale") String locale, javax.servlet.http.HttpServletRequest request)
-
swaggerUiWelcomePage
@GetMapping({"/swagger-ui","/swagger-ui/"}) public String swaggerUiWelcomePage()
-
-