Digitalocean部署的角度设置
我正在尝试在Digitalocean上部署Angular App。我从那里的应用菜单创建了应用程序,并说它已经建立了成功。但是当我访问现场网址时,它说无法/(404来自控制台)
但是,当我访问我的REST ENDPOINT(API)时,它会很好地打印结果:
意见表明问题似乎可能在路由中?如果是这样,那么我可能需要做的改变才能使它起作用(我还想补充一下本地所有内容都可以按预期工作)。
I am trying to deploy angular app on DigitalOcean. I created application from App menu there and it says that it got built successfuly. But when I visit my live url, it says Cannot get / (404 from console)
However when I access my REST endpoint (API), then it prints result nicely:
This in my opinion indicates that the problem seems to be maybe in routing? If so, then what changes I might need to do in order to make it work (I would also like to add that locally everything works as expected).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
哈哈!问题简直就是关于角dist文件夹。 ng构建将我的东西放入dist/项目名称,但最终我只是从“ outputpath”中更改了“ outputpath”(在angular.json中):“ dist/ project name ”到“ outputpath”:“ dist/”,然后开始工作。
LOL! The issue simply was about Angular dist folder. ng build put my stuff into dist/Project Name, but eventually I simply changed "outputPath" (in angular.json) from "outputPath" : "dist/Project Name" to "outputPath" : "dist/" and it started working then.