You can use route matching in react server rendering. There is a match method in react-router You can look at the code commented in https://github.com/zhanfang/koa-react-weixin. I think This is not very necessary. Another way is what I am doing now. You can refer to the code in the link
React Router official documentation mentions that if the front-end is routed, the back-end only needs to return the HTML file to the corresponding path. You can try
You can use route matching in react server rendering. There is a match method in react-router
You can look at the code commented in https://github.com/zhanfang/koa-react-weixin. I think This is not very necessary. Another way is what I am doing now. You can refer to the code in the link
I found a way, it seems that koa does not handle 404, it feels good
react-router is a front-end routing, it is different from koa's routing
React Router official documentation mentions that if the front-end is routed, the back-end only needs to return the HTML file to the corresponding path. You can try
It shouldn’t matter, the front-end and back-end routing are not mentioned to be unified
KOA points to index.html when 404 occurs
Reference
router.get('*',(ctx, next) => {
ctx.type = 'html';
ctx.body = fs.createReadStream('./index .html');
});