Creating micro-services project HelloWorld a test of

Creating micro-services project HelloWorld a test of

Create a project

Writing the Service Code

@RestController
 public  class the HelloWorld { 

    @RequestMapping ( "/ Hello" )
     public String the Hello (@RequestParam String name) {
         return "Hello!" + Name + ", which is a micro-services." ; 
    } 
}

Edit the configuration file application.properties:

spring.application.name=spring-cloud-provider-01
server.port=9000

Test Run

Source

github

Guess you like

Origin www.cnblogs.com/bluersw/p/11607651.html
Recommended