diff --git a/backend/src/main/java/djmil/cordacheckers/ReactAppController.java b/backend/src/main/java/djmil/cordacheckers/ReactAppController.java new file mode 100644 index 0000000..d030f23 --- /dev/null +++ b/backend/src/main/java/djmil/cordacheckers/ReactAppController.java @@ -0,0 +1,20 @@ +package djmil.cordacheckers; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PutMapping; + +import jakarta.servlet.http.HttpServletRequest; + +@Controller +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/*","/about","/leaderboard" }) + @PutMapping("/error") + public String getIndex(HttpServletRequest inRequest) { + return "/index.html"; + } + +} diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index aa7972a..9c12aa8 100644 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -8,4 +8,6 @@ corda.root.login=admin corda.root.passw=admin corda.client.maxPollAttempts=30 -server.port=8081 \ No newline at end of file +server.port=8081 + +#logging.level.org.springframework.web=DEBUG \ No newline at end of file