创建项目

创建Spring Boot微服务项目
创建Spring Boot微服务项目
创建Spring Boot微服务项目
创建Spring Boot微服务项目

编写服务代码

@RestController
public class HelloWorld {

	@RequestMapping("/hello")
	public String Hello(@RequestParam String name){
		return "你好!" + name + ",这是一个微服务。";
	}
}

编辑配置文件application.properties:

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

创建Spring Boot微服务项目

测试运行

创建Spring Boot微服务项目

源码

Github仓库:https://github.com/sunweisheng/spring-cloud-example

相关文章:

  • 2021-04-07
  • 2021-05-24
  • 2021-05-04
  • 2021-06-25
  • 2021-08-06
猜你喜欢
  • 2021-12-01
  • 2021-05-23
  • 2021-08-18
  • 2021-03-27
  • 2021-04-23
  • 2021-07-18
相关资源
相似解决方案