一. 创建Spring Cloud Server端
修改appliation.properties文件为application.yml,并加入下面内容:
在resources下新建config文件夹,文件夹中新建文件eurekaapplication-dev.yml,内容如下:
启动类中加入注解@EnableConfigServer
启动程序
二. 创建Spring Cloud Config Client端
在resources中创建bootstrap.yml文件,内容如下:
创建Controller,进行测试
启动服务
浏览器输入路径http://localhost:8001/hello