简体   繁体   English

将React App部署到AWS

[英]Deploying a React App to AWS

I have a website using express/ react which consist of two separate parts. 我有一个使用Express / React的网站,其中包含两个单独的部分。 1- API app (express server) 2- Website (react app) 1- API应用程序(快速服务器)2-网站(实际应用程序)

I was fiddling around with AWS to deploy my app and figured out few options. 我在摆弄AWS来部署我的应用程序,并想出了一些选择。 So far the best option for the API is to use Elastic Beanstalk. 到目前为止,API的最佳选择是使用Elastic Beanstalk。 It works well and I had no issues with it. 它运作良好,我对此没有任何问题。

The confusing part is the react app. 令人困惑的部分是React应用。 I have deployed it once as Elastic Beanstalk and once as S3 bucket. 我曾经将其部署为Elastic Beanstalk,并将其部署为S3存储桶。 Both worked with some challenges ( easier was the S3) 两者都遇到了一些挑战(S3更容易)

I want to ask if anyone has been in the same scenario and have any recommendations? 我想问问是否有人遇到过同样的情况并且有什么建议吗?

In my experience it is better (for the sake of better scalability) to split the API server and CDN for bundled React App. 以我的经验,最好将API服务器和CDN拆分为捆绑的React App(以实现更好的可伸缩性)。 You can use the CloudFront as CDN for the App and EC2 as API. 您可以将CloudFront用作App的CDN,将EC2用作API。

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

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