If you use Maven, you can run the application by using:
./mvnw spring-boot:runAlternatively, you can build the JAR file with:
./mvnw clean packageAnd then run the JAR file:
java -jar target/rest_service-0.0.1-SNAPSHOT.jarOnce the application is running, you can view the greeting by navigating to:
http://localhost:8080/greeting
You should see a JSON response similar to:
{
"id": 1,
"content": "Hello, World!"
}You can also customize the greeting by adding a name parameter:
http://localhost:8080/greeting?name=Justin
This will return a response like:
{
"id": 2,
"content": "Hello, Justin!"
}