'Can I use AWS Elastic Beanstalk to host a Spring Boot application

I have a front-end and a back-end. Front end is made using HTML,CSS,and ajax calls to fetch the backend data.

The backend is a Spring Boot application.

For the front end I do not have a middleware as it is plain HTML,so I am hosting it using nginx on aws. The backend is Spring Boot and runs on tomcat(default), how do I host these on aws and connect the front and backend. Do I need an EC2 instance or something like elastic beanstalk is preferred.



Solution 1:[1]

To answer your question - yes using Elastic Beanstalk to host your Spring BOOT application is a valid way to deploy it on AWS. I have a similar app that returns JSON data - as shown below. I have separate React app that consumes this Spring BOOT Rest API.

You asked how to connect the front end and back end. It is typically done via Restful Get or Post requests. For example, I can connect to my Spring Boot Rest API in React using a lib like Axios.

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1