SpringCloud环境搭建-gateway

Published on with 0 views and 0 comments
  1. 添加依赖
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-gateway</artifactId>
</dependency>
  1. 配置 nacos 注册中心
    2.1 添加依赖
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-consul-discovery</artifactId>
    </dependency>
    

    2.2 启动类增加注解
    @EnableDiscoveryClient
    2.3 配置bootstrap.yml

    spring:
        cloud:
            nacos:
                config:
                    server-addr: 192.168.193.106:8848
                    file-extension: yaml
                    namespace: 7878f4aa-7519-428f-8cbd-2826ff266d3c
    

标题:SpringCloud环境搭建-gateway
作者:weiweihaha
地址:http://blog.lijida.cn/articles/2020/03/14/1584176986334.html