Creating micro-services project HelloWorld a test of
Create a project
Writing the Service Code
@RestController
public class HelloWorld {
@RequestMapping("/hello")
public String Hello(@RequestParam String name){
return "你好!" + name + ",这是一个微服务。";
}
}
Edit the configuration file application.properties:
spring.application.name=spring-cloud-provider-01
server.port=9000
Test Run
Source
Github repository: https: //github.com/sunweisheng/spring-cloud-example