From 7f51cf32c29a097072ff6c24b7e5343c6f2088ef Mon Sep 17 00:00:00 2001 From: djmil Date: Sat, 2 Dec 2023 01:43:42 +0100 Subject: [PATCH] rectrouter version update --- .../main/java/djmil/cordacheckers/ReactAppController.java | 8 ++++---- webapp/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/src/main/java/djmil/cordacheckers/ReactAppController.java b/backend/src/main/java/djmil/cordacheckers/ReactAppController.java index 5d53593..5cfc464 100644 --- a/backend/src/main/java/djmil/cordacheckers/ReactAppController.java +++ b/backend/src/main/java/djmil/cordacheckers/ReactAppController.java @@ -1,7 +1,8 @@ package djmil.cordacheckers; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PutMapping; import jakarta.servlet.http.HttpServletRequest; @@ -10,9 +11,8 @@ 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") - @RequestMapping(value = { "/", "/{x:[\\w\\-]+}", "/{x:^(?!api$).*$}/*/{y:[\\w\\-]+}","/error" }) + @GetMapping(value = { "", "/", "/games", "/games/*", "/about","/leaderboard" }) + @PutMapping("/error") public String getIndex(HttpServletRequest inRequest) { return "/index.html"; } diff --git a/webapp/package.json b/webapp/package.json index 547219c..81c2f9a 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -9,7 +9,7 @@ "fsevents": "^2.3.3", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-router-dom": "^6.16.0", + "react-router-dom": "^6.20.1", "react-scripts": "^5.0.1", "web-vitals": "^3.5.0" },