11.服务端连接git

服务端连接到github,然后客户端连接到服务端
1. 项目配置

1.主启动类
@SpringBootApplication @EnableConfigServer//开启配置服务 public class ConfigServer_3344 { public static void main(String[] args) { SpringApplication.run(ConfigServer_3344.class,args); } }
2.配置文件
server: port: 3344 spring: application: name: springcloud-config-server #连接远程仓库 cloud: config: server: git: uri: https://gitee.com/wx_b0645f16e0/cloud-eviro.git
3.依赖
<!--web--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-config-server</artifactId> <version>2.1.1.RELEASE</version> </dependency>
实现的效果 git仓库创建如下文件 注意必须是开源的

使用3344端口直接读取此窗口文件


浙公网安备 33010602011771号