srm-template
Shows a basic implementation of a springboot micro-service that can be used as a foundation for creating other micro-services
- Java 1.10
- Maven
- SpringBoot
git clone git@github.com:digital-delivery-academy/srm-springboot-template.git
mvn clean package
- Run
java -jar "/target/template-0.0.1-SNAPSHOT.jar"
to launch the server
- Clone master and run
mvn clean install
in its directory - Import project into IntelliJ
- Enable Maven auto-import
- Create new SpringBoot configuration
- Set
Main Class
toio.lampada.TemplateApplication
- Press Run to launch server
- Run command
mvn clean install
- Create new JUnit Configuration
- Set
Test Kind
toAll in Package
- Set
Search for Tests
toIn Whole Package
- Run configuration
- Run
mvn clean install
on project - Run
java -jar "/target/template-0.0.1-SNAPSHOT.jar"
to launch the server
A server should deploy to the port set in Application.Properties
GET / #Get all example entities stored in the microservice in JSON
GET /12 #Get example by ID in JSON (12 in this example)
GET /health #Returns health-checks, i.e. JSON {"status":"UP"} and status 200 OK
POST / #Post a new example entity (look at #Schema for more information)
POST Example JSON payload
{
"exampleId" : 12
}