简体   繁体   English

如何在 AWS 上托管 Spring Boot 应用程序(后端)和 React 应用程序(前端)?

[英]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.

相关问题 我们可以在 React 前端从 Spring Boot 后端渲染 InputStream 吗? - Can we render InputStream from Spring Boot Backend on React Frontend? 在为 spring 引导后端和反应前端启用跨源时遇到问题 - Getting problem in enabling cross origin for spring boot backend and react frontend 前端(React)不向 Heroku 上的后端(Spring Boot)发送请求 - Frontend (React) doesn't send requests to backend (Spring Boot) on Heroku 由于 CORS 策略,React 前端无法与 Spring 引导后端通信 - React frontend cannot communicate with Spring Boot backend because of CORS policy 如何使用spring boot和react.js为单页面应用程序项目设置AWS - how to setup AWS for single page application project with spring boot and react.js 如何从Spring Boot应用程序为React应用程序提供服务? - How do I serve a React application from an Spring Boot application? 将本地 React 前端连接到本地 Spring Boot 中间件应用程序时出现 CORS 错误 - CORS error when connecting local React frontend to local Spring Boot middleware application 如何将反应前端添加到 Spring Boot Rest? - How to add react frontend to spring boot rest? 前端和后端的应用程序安全实践 - Application security practices for frontend and backend 获取响应是 401 Unauthenticated React Frontend Spring Boot Backend with Spring Security - Fetch response is 401 Unauthenticated React Frontend Spring Boot Backend with Spring Security
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM