Skip to main content

Posts

Showing posts with the label restful

RESTful API Hello World with Spring Boot

Reference Spring Microservices in Action, Manning, 2017 Jun,  https://www.manning.com/books/spring-microservices-in-action Getting Started · Building a RESTful Web Service,  https://spring.io/guides/gs/rest-service/ Environment Maven: 3.5.2 JDK: 1.8.0_131, vendor: Oracle Corporation OS: "windows 10" IDE Spring Tool Suite 3.9.4.RELEASE 1. Create the Maven project https://start.spring.io/ Maven project with Java and Spring Boot: 1.5.13 (failure to start) 1.5.10 Group: com.wonderland.api Artifact: helloworld-service Dependencies: Actuator #for the metric later Web Rest Repositories Eureka Discovery #for the API registration and discover later Download: helloworld-api.zip Unzip into {project folder} Import into IDE: File > Import > Existing Maven Projects > {project folder} > Finish 2. Change the Code 2.1. Add class Greeting with attribute name #force the JSON response with Object return 2.2. Add class Helloworl...