Source Code and materials for "Spring Boot…tweeting complete Spring applications since 2013". To run the samples import the project into Spring Tool Suite 3.5.
To run the application in place use
$ cd demo
$ mvn clean spring-boot:run
To create an executable war that can also be deployed to a container use
$ cd demo
$ mvn clean package
$ java -jar target/demo-0.0.1-SNAPSHOT.war
The following provides information on setting up a development environment that can run the sample in [Spring Tool Suite 3.5.0+](http://www.springsource.org/sts). Other IDE’s should work using Maven’s IDE support, but have not been tested and do not have some of extras demonstrated in the presentation.
-
IDE Setup
-
Install Spring Tool Suite 3.5.0+
-
Importing the project into Spring Tool Suite
-
Ensure to import both the demo module and the rest-mvc-autoconfiguration module
-
File→Import…→Maven Project
-
Right click on demo/src/main/java/demo/Application.java and select Run As→Java Application
-
You can view all the Messages with a GET http://localhost:8080/messages/
-
You can add a Message with a POST to http://localhost:8080/messages/ The body should be
{ "text" : "Some message" }
-
… additional rest semantics apply …
Note
|
The Accept and Content-Type headers should be set to "application/json" |
You can view the HAL Browser at http://localhost:8080/browser/index.html