您现在的位置是:网站首页> 编程资料编程资料

Config服务端连接Git配置的技巧_相关技巧_

2023-05-27 329人已围观

简介 Config服务端连接Git配置的技巧_相关技巧_

Config:服务端连接Git配置,代码如下所示:

1、导入依赖

org.springframework.bootspring-boot-starter-weborg.springframework.bootspring-boot-devtoolsorg.springframework.cloudspring-cloud-config-server

2、编写配置文件

 server: port: 3344 spring: application: name: Git-config-3344 #连接远程仓库 cloud: config: server: git: uri: https://gitee.com/xiao-yunshan/gittest.git

3、编写启动类

 @SpringBootApplication @EnableConfigServer public class Git_3344 { public static void main(String[] args) { SpringApplication.run(Git_3344.class,args); } }

4、启动访问

http://localhost:3344/application-dev.yml

到此这篇关于Config服务端连接Git配置的技巧的文章就介绍到这了,更多相关Config服务端连接Git配置内容请搜索以前的文章或继续浏览下面的相关文章希望大家以后多多支持!

-六神源码网