angular.js - After packaging the project with angular2-cli, a 404 error will be reported when refreshing the jump route
天蓬老师
天蓬老师 2017-05-15 17:10:28
0
4
665

After the Aangular2 project is packaged using the ng build command under anguar2-cli, run the static index.html file in the dist folder. There is no problem with the first route jump, but if the page is refreshed in the jumped route, A 404 error will be returned.

GitHub code link: https://github.com/borysn/spr...

After clicking register on the main page, it will jump to the registration page normally. However, if you refresh the registration page, 404 will be returned

I don’t know if anyone else has encountered this situation. If so, please let me know the solution.

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(4)
小葫芦

Adding {useHash:true} in the route can solve this problem

phpcn_u1582

Same question, I am also looking for this problem

習慣沉默

You can use Nginx to do a layer of routing transfer, first jump to the homepage, and then use the routing strategy to perform related rendering

習慣沉默

Whether dynamic parameters are set for the route? If so, this problem may occur. I am also working on solving it

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