This is a simple Spring Boot app that showcases a basic pattern to build an API.
You can find the endpoint deployed on Heroku and the url for the endpoint is https://obot-api.herokuapp.com/.
To access the swagger documentation you can go to this url: https://obot-api.herokuapp.com/swagger-ui/index.html
To see how this app evolved over time, you can look at the pull requests here: https://github.com/robot297/spring-example/pulls
To get started, you can use the Spring Initializer to generate the scaffolding for your new Spring project.
I've also included the use of Docker to in case you wanted to see how your app can be cloud ready (though this does not deploy to the cloud).
To test the endpoints, it is recommended that you use Postman.
Endpoint | Web method | What to send | Expected Result |
---|---|---|---|
/health | GET | N/A | App is OK |
/movie | POST | {"movieName" : "Movie","rating" : 4} |
{ "id": 1,"movieName": "Movie","rating": 4} |
/movie | GET | N/A | [{"id":1,"movieName":"null","rating":4}] |
/movie | PUT | { "id": 1,"movieName": "Movie","rating": 4} |
{ "id": 1,"movieName": "Movie","rating": 4} |