Spring boot hello-world example
Spring boot is a Java framework to build backend Java applications. I decided to write this blog post because I saw 7 forks in my Github repository where I wrote a spring boot helloworld application some time ago and I thought could be interesting to share.
Where is the repository
Here’s the link to the Github repository : https://github.com/alexmanrique/spring-boot-application-example
If you want to try it you just need to clone the repository in your local environment using:
git clone https://github.com/alexmanrique/spring-boot-application-example.git
Prerequisites
To run the app you need to have Maven installed in your local environment to be able to download all the dependencies of the project. You need to have also installed Java 8 JDK.
Once you have cloned the repository you can open the repository in Intellij IDEA or your favorite IDE.
How to start the app
If you go to the class MyappServer.java then you can run the spring boot application, as simple as that.
If everything is right you will see the Spring logo in console
And a message that the application is up and running:
Swagger UI
The app uses Swagger to display useful documentation of the different endpoints and it’s easier to start playing doing calls to the API.
Postman calls
If you prefer to use Postman I share with you a Postman collection to test the Spring boot api that we have just started:
https://www.getpostman.com/collections/6e45d359bad60ea7b588
Here we can see a call to get all the cars that we have in the API.
Here you can see a call to find all drivers that are with status ONLINE
You can use the calls that are in Swagger page and add them to the Postman collection.
Conclusion
In this post, we have seen how to start a Spring boot application and how to do some calls using Swagger and Postman.
Comments