加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angular2 – Angular 2.0路由器不工作重新加载浏览器

发布时间:2020-12-17 09:06:46 所属栏目:安全 来源:网络整理
导读:我使用Angular 2.0.0-alpha.30版本。当重定向到不同的路由,然后刷新浏览器,它显示Can not GET / route。 你能帮我找出为什么这个错误发生了。 The error you are seeing is because you are requesting 07000 which doesn’t exist. According to 07001.
我使用Angular 2.0.0-alpha.30版本。当重定向到不同的路由,然后刷新浏览器,它显示Can not GET / route。

你能帮我找出为什么这个错误发生了。

The error you are seeing is because you are requesting 07000 which doesn’t exist. According to 07001.

使用html5路由时,您需要将应用程序中的所有路由(当前为404)映射到服务器端的index.html。这里有一些选项:

>使用live-server:https://www.npmjs.com/package/live-server

$ live-server –entry-file = index.html

>使用nginx:http://nginx.org/en/docs/beginners_guide.html

error_page 404 = 200 /index.html

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读