问题描述
我在AWS上开发了一个reactJS项目(前端),该项目具有来自heroku的RESTFUL API。它们是完全分开的,即前端和后端。
I developed a reactJS project (front-end) on AWS which has it RESTFUL API coming from heroku. They are completly separated i.e the frontend and backend.
我已成功将文件上传到S3,并激活了CloudFront发行版,但是我真的无法弄清楚是什么。是错误的,因为当我点击从域名生成的URL时,我看不到我的react应用程序。
I have successfully uploaded my files to S3, and have activated my CloudFront Distributions, but I can't really figure out what is wrong because I can't see my react app when I hit the URL generated from the Domain name.
我已经检查了此,但没有帮助。
I have checked this SO answer, but it doesn't help.
请多多帮助。
推荐答案
首先,将它们部署在不同的服务器/云上非常好。您可以提供网址吗?我觉得这不是不同云的问题,而是配置问题。您能否先将一个简单的html文件放在同一个S3存储桶中,看看是否可以通过域名访问该文件。
Firstly, it is perfectly fine to deploy them on different servers/cloud. Can you give the URL ? I feel it is not issue of different clouds but configuration issue. Can you first put a simple html file on same S3 bucket and see if you can access that via your domain name.
假设您将react app example.com托管在名为ant的存储桶中。因此,继续并将其他test.html放入bucket ant中。然后尝试example.com/test.html ..这将确保您的域设置等正确。
Suppose you have your react app example.com hosted in bucket named ant. So, go ahead and put additional test.html in bucket ant. Then try example.com/test.html .. This will make sure your domain setting etc. are proper
这篇关于如何在AWS上激活/显示ReactJS应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!