prod-react-routing #48

Merged
djmil merged 6 commits from prod-routing into main 2023-12-02 02:12:42 +01:00
3 changed files with 11 additions and 13 deletions
Showing only changes of commit 49dcd38ab3 - Show all commits

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,14 +46,12 @@ function ViewSelector() {
const guide = useContext(GamesGuideContext);
return (
<nav>
<div 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>
<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>
</nav>
)