acs254
acs254

Reputation: 533

Interacting with Spring Boot + DynamoDB

I'm struggling to learn how I go about building, packaging, and deploying a Spring REST API locally so that I can interact with it? Ideally, I'd just like to GET and POST data as practice -- specifically integrating with DynamoDB.

I've cloned this DynamoDB project and built it using mvn package so that I have a jar file. I moved the jar file to the webapp directory of Apache and started the server, but I cannot interact with the API in any way. The project is structured as follows:

enter image description here

Once Apache is running with the jar in the webapp directory, I've tried accessing the API at:

Each gives a 404 error. And yes, DynamoDB is running locally. So what do I need to do differently? How can I deploy and access this API locally?

Upvotes: 0

Views: 426

Answers (1)

chinoy
chinoy

Reputation: 172

The project you have cloned is a spring boot project, hence you can use mvn spring-boot:run to run the application locally.You can also run it by running the com.baeldung.Application class as a java application from the IDE. For more details on how to run a spring boot app you can follow this link. Spring boot parent has a dependency on the embedded tomcat, which will run the application.

Additionally if you want to deploy the application as a war the spring boot documentation shows how to do it.

Upvotes: 2

Related Questions