Need to rewrite everything
a little sandbox for an easy start playing with spring boot features
From command line you can do
mvn clean package
this will create the standard spring boot jar inside the target direcotry
You can start up the sand box in different ways
As a standalone jar
java -jar springboot-sandbox-0.0.1-SNAPSHOT
With a maven (thanks to the spring-boot-maven-plugin)
mvn spring-boot:run
Running the main of the SpringbootSandboxApplication class (with an IDE)
This project include the spring-boot-devtools and is ready for the auto reload even with maven.
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
</plugin>
</plugins>
</build>
You need the fork in the plugin
The autoreload is triggered when the files in the classpath change(needs a build -> CTRL+F9 in intellij)
Handles and behaviour
/greeting -> You need to be logged in to be greet
/auth/token -> JWT token, you should be logged in to see this. Check the token here
POST Some data to the H2 db
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{ "firstName" : "Frodo", "lastName" : "Baggins" }' http://localhost:8080/people
For test purpose there is some security implemented as basic http
you can access with
username: poldo
password: poldone
You can change it in the SpringbootSandboxApplication class
You can check the status of services at /health Actually is just the basic check of Actuator
a list of link that I used to better understand spring boot and some other little things
- http://www.programcreek.com/java-api-examples/index.php?api=org.springframework.boot.CommandLineRunner
- spring-guides/tut-rest#10
- https://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html#approach6
- https://www.youtube.com/watch?v=CBwlgvfllNk
- https://github.com/joshlong
- https://spring.io/understanding/HATEOAS
- http://presos.dsyer.com/decks/microservice-security.html
- https://spring.io/blog/2014/11/07/webinar-replay-security-for-microservices-with-spring-and-oauth2
- http://blog.jdriven.com/2014/10/stateless-spring-security-part-2-stateless-authentication/
- http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/ also the freamwork need attention