diff --git a/backend/src/main/java/djmil/cordacheckers/ReactAppController.java b/backend/src/main/java/djmil/cordacheckers/ReactAppController.java index 5cfc464..5d53593 100644 --- a/backend/src/main/java/djmil/cordacheckers/ReactAppController.java +++ b/backend/src/main/java/djmil/cordacheckers/ReactAppController.java @@ -1,8 +1,7 @@ package djmil.cordacheckers; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestMapping; import jakarta.servlet.http.HttpServletRequest; @@ -11,8 +10,9 @@ public class ReactAppController { // This controller simply redirects all UI related routes // to index.html, allowing react and react-router to work its magic - @GetMapping(value = { "", "/", "/games", "/games/*", "/about","/leaderboard" }) - @PutMapping("/error") + // @GetMapping(value = { "", "/", "/games", "/games/*", "/about","/leaderboard" }) + // @PutMapping("/error") + @RequestMapping(value = { "/", "/{x:[\\w\\-]+}", "/{x:^(?!api$).*$}/*/{y:[\\w\\-]+}","/error" }) public String getIndex(HttpServletRequest inRequest) { return "/index.html"; } diff --git a/webapp/public/index.html b/webapp/public/index.html index ec6e3d2..4cb1350 100644 --- a/webapp/public/index.html +++ b/webapp/public/index.html @@ -9,7 +9,7 @@ name="description" content="Web site created using create-react-app" /> - +