different reactappcontroller mapping

This commit is contained in:
djmil 2023-12-02 01:24:19 +01:00
parent 50a8d7d0f8
commit 49dcd38ab3
3 changed files with 11 additions and 13 deletions

View File

@ -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";
}

View File

@ -9,7 +9,7 @@
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!-- <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> -->
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/

View File

@ -46,15 +46,13 @@ function ViewSelector() {
const guide = useContext(GamesGuideContext);
return (
<nav>
<div className='ViewSelector'>
<nav className='ViewSelector'>
<div className='Container' >
<Link to='new'>New</Link>
<Link to='proposal'>Proposal<Counter number={guide.awaiting.proposal} /></Link>
<Link to='active' >Active<Counter number={guide.awaiting.active} /></Link>
<Link to='archive' >Archive</Link>
</div>
</div>
</nav>
)
}