[英]Deploying React App with Spring Boot REST API in AWS BeanStalk
I'm trying to deploy 2 instances (front and back end) separately.我正在尝试分别部署 2 个实例(前端和后端)。 Currently, the back end which is the REST API using SpringBoot was successfully deployed in BeanStalk as a.jar file.
目前,使用 SpringBoot 的后端 REST API 已成功部署在 BeanStalk 中,为 .jar 文件。 Now, I have never deploy a front end app (in my case my React app) separately in AWS BeanStalk and I have been doing my research but I'm stuck.
现在,我从未在 AWS BeanStalk 中单独部署前端应用程序(在我的情况下是我的 React 应用程序),我一直在做我的研究,但我被困住了。 How do I "compile" my React app and deploy it in BeanStalk like I did with the back end?
我如何像在后端一样“编译”我的 React 应用程序并将其部署在 BeanStalk 中?
I got it, for anyone in the future needs help with this, all you have to do just follow these steps:我明白了,对于将来需要帮助的任何人,您只需按照以下步骤操作即可:
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::(name-of-your-bucket)/*"
}
]
}
"deploy": "aws s3 cp --recursive./build s3://(your-bucket-name)",
execute npm run build in terminal在终端中执行npm 运行构建
execute aws s3 cp --recursive./build s3://(your-bucket-name) in terminal
(you are uploading your build files inside the build folder to s3) aws s3 cp --recursive./build s3://(your-bucket-name) in terminal
(您正在将构建文件夹中的构建文件上传到 s3)
go to properties -> static web hosting -> point out the index.html if you use that -> click the end point go 到属性 -> static web 托管 -> 指出您使用的索引。ZFC35FDC70D5227D256988
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.