Here we will make a simple rest API that will return hard-coded messages using spring boot.
Here in this code, I made a simple rest API that will return hardcoded messages on the specific URL using spring boot.
You can check the dependencies of the project in the pom.xml file.
It will be best if you use Eclipse IDE to run a Java application.
Here in this code what I had done is that if you type URL http://localhost:8080/player-details on the web then it will return the details of a player and is mapped on this URL in the JSON format.
You can change the response data in the application.properties file.
So go on and try this code.
Submitted by Satvik Singh Sengar (satviksinghsengar)
Download packets of source code on Coders Packet
Comments