简体   繁体   English

AWS 使用 angular 放大路由

[英]AWS amplify routing with angular

I've build and angular 8 app and deployed to AWS amplify by connecting to a branch in my repository.我已经构建了 angular 8 应用程序,并通过连接到我的存储库中的一个分支部署到 AWS 放大。
Routing works on my localhost and it also works on deployed version.路由适用于我的本地主机,也适用于已部署的版本。 The problem is when I reload the page on some sub-route.问题是当我在某个子路由上重新加载页面时。
在此处输入图片说明
It looks like amplify routing takes care of that request and ignore my angular routing.看起来放大路由会处理该请求并忽略我的角度路由。 Reload only works on root page.重新加载仅适用于根页面。
I tried this https://docs.aws.amazon.com/amplify/latest/userguide/redirects.html with redirecting /<*> everything to '/' but I had no luck with that.我试过这个https://docs.aws.amazon.com/amplify/latest/userguide/redirects.html将 /<*> 一切都重定向到 '/' 但我没有运气。
Where and how can I change the way Amplify handles url paths?我在哪里以及如何更改 Amplify 处理 url 路径的方式?

Please try this solution请试试这个解决方案

I also had the same issue and when I apply "Redirects for Single Page Web Apps (SPA)" method it solved everything我也遇到了同样的问题,当我应用“重定向单页 Web 应用程序(SPA)”方法时,它解决了所有问题

Official Doc: https://docs.aws.amazon.com/amplify/latest/userguide/redirects.html官方文档: https : //docs.aws.amazon.com/amplify/latest/userguide/redirects.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM