###Creating a project Two ways to quickly set up a Spring Boot project:
-
With the Spring Boot CLI (easy installation with GVM). The command that created this project:
spring init -d=data-rest,data-jpa --build=gradle tech-talk-spring-boot
-
Using the Spring Initializr Application to generate your Gradle build file.
###Building and running
Build the project:
./gradlew build
Run the application:
java -jar build/libs/registration-0.0.1-SNAPSHOT.jar
Hit the application:
curl localhost:8080
Hit the robots resource that we set up:
curl localhost:8080/robots
[credit to dan-dare.org for the picture]
Add a robot:
curl -i -X POST -H "Content-Type:application/json" -d '{ "name" : "Dick Dastardly" }' localhost:8080/robots
Check out the robot we just created:
curl localhost:8080/robots