SpringCloud 分享(1)-ConfigServer的使用

示例代码路径 https://github.com/wangjiuong/SpringCloud/tree/master/SpringConfigServer

代码中配置了两个配置文件,开发者可以根据使用配置自己需要的。

然后在application.properties配置文件中配置路径和查询文件夹

server.port=8888
spring.cloud.config.server.git.uri=https://github.com/wangjiuong/SpringCloud.git
spring.cloud.config.server.git.searchPaths=cloud-config-repo

 

 工程下载后,maven 编译,执行运行代码 

访问http://127.0.0.1:8888/cloud-config/dev/master获取开发环境的配置信息

访问http://127.0.0.1:8888/cloud-config/test/master获取测试环境的信息

 

posted @ 2017-08-29 23:14  王久勇  阅读(155)  评论(0)    收藏  举报