[英]How to host a Spring Boot Application (backend) and React Application (frontend) on AWS?
I am a beginner in AWS and want to host a website whose backend is on Spring on frontend on React.我是 AWS 的初学者,想在 React 的前端托管一个后端在 Spring 上的网站。 I think we have to do it by using EC2 instances, my senior mentioned it.
我认为我们必须通过使用 EC2 实例来做到这一点,我的前辈提到过。 Any help at all is appreciated.
任何帮助都将不胜感激。 Right now in my react application, the data submitted by the user is being sent to localhost:8080 where my spring boot application is hosted.
现在在我的 React 应用程序中,用户提交的数据被发送到 localhost:8080 我的 Spring Boot 应用程序托管的地方。 I think I'll have to host these 2 applications separately and follow the same procedure.
我想我必须分别托管这两个应用程序并遵循相同的程序。
Here is an AWS tutorial that walks you through this use case.这是一个 AWS 教程,将引导您完成此用例。 The Front end is a React App that sends requests to a Spring Rest Backend that returns JSON.
前端是一个 React 应用程序,它将请求发送到返回 JSON 的 Spring Rest 后端。
https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javav2/usecases/Creating_Spring_RDS_%20Rest https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javav2/usecases/Creating_Spring_RDS_%20Rest
The React app displays the data. React 应用程序显示数据。 I have successfully deployed the Spring backend on Elastic Beanstalk -- as shown here:
我已经在 Elastic Beanstalk 上成功部署了 Spring 后端——如下所示:
To learn how to deploy a Spring App on Elastic Beanstalk, see the section titled Deploy the application to Elastic Beanstalk in this tutorial.要了解如何在 Elastic Beanstalk 上部署 Spring 应用程序,请参阅本教程中标题为将应用程序部署到 Elastic Beanstalk的部分。
https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javav2/usecases/creating_first_project https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javav2/usecases/creating_first_project
All of the information you need to get this use case working is in these 2 articles.让这个用例工作所需的所有信息都在这两篇文章中。
Take a look at the workshop for Web application Development with AWS Elastic Beanstalk .查看使用 AWS Elastic Beanstalk 进行 Web 应用程序开发的研讨会。 You will learn how to deploy a React frontend and a Node.js backend.
您将学习如何部署 React 前端和 Node.js 后端。 Since you want to use Spring Boot for your backend, adapt that part of the workshop by applying what you learn in this step-by-step guide Deploying a Spring Boot Application on AWS Using AWS Elastic Beanstalk .
由于您想将 Spring Boot 用于后端,因此通过应用您在本分步指南使用 AWS Elastic Beanstalk 在 AWS 上部署 Spring Boot 应用程序中学到的知识来调整研讨会的这一部分。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.