欢迎来到代码驿站!

当前位置:首页 >

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

时间:2022-08-27 09:39:02|栏目:|点击:

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

1、导入依赖

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-config-server</artifactId>
    </dependency>
</dependencies>

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

上一篇:用R语言实现霍夫曼编码的示例代码

栏    目:

下一篇:JS中的四种数据类型判断方法

本文标题:Config服务端连接Git配置的技巧

本文地址:http://www.codeinn.net/misctech/211997.html

推荐教程

广告投放 | 联系我们 | 版权申明

重要申明:本站所有的文章、图片、评论等,均由网友发表或上传并维护或收集自网络,属个人行为,与本站立场无关。

如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:914707363 | 邮箱:codeinn#126.com(#换成@)

Copyright © 2020 代码驿站 版权所有