javascript - Conflict between front-end and back-end routing?
迷茫
迷茫 2017-05-19 10:39:13
0
2
708

This is my front-end routing. It seems to have no problem, but when the browser refreshes locahost:4000/select/ProfessionalElective, the page will become blank. It must be entered from other routing points. I looked at the loading js and css, the paths become localhost:4000/select/js and localhost:4000/select/css. Shouldn't it be localhost:4000/js? I can directly refresh the path localhost:4000/select page and it will be displayed. What is the problem?


The routing of my node is written like this.

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(2)
仅有的幸福

<script src='path/to/js'></script>
应该以绝对路径方式写 ,<script src="/select/js/..."></script> in

index.html or index.jade
迷茫

This is about the conflict between front-end and back-end routing. Basically, when you use browserHistory, the front-end routing is not available in the back-end. When you refresh the page, the browser will request the page from the server. If the back-end does not set this route, it will naturally report 404. .

Please read the documentation for details, react-router

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template