zuul网关改为gateway
This commit is contained in:
@@ -28,6 +28,10 @@
|
||||
<groupId>com.macro.mall</groupId>
|
||||
<artifactId>mall-mbg</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-security</artifactId>
|
||||
|
||||
@@ -26,6 +26,10 @@
|
||||
<groupId>com.macro.mall</groupId>
|
||||
<artifactId>mall-mbg</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-netflix-zuul</artifactId>
|
||||
<artifactId>spring-cloud-starter-gateway</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -3,9 +3,7 @@ package com.macro.mall;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
|
||||
|
||||
@EnableZuulProxy
|
||||
@EnableDiscoveryClient
|
||||
@SpringBootApplication
|
||||
public class MallGatewayApplication {
|
||||
|
||||
@@ -3,16 +3,17 @@ server:
|
||||
spring:
|
||||
application:
|
||||
name: mall-gateway
|
||||
cloud:
|
||||
gateway:
|
||||
discovery:
|
||||
locator:
|
||||
enabled: true
|
||||
lower-case-service-id: true #使用小写service-id
|
||||
eureka:
|
||||
client:
|
||||
register-with-eureka: true
|
||||
fetch-registry: true
|
||||
service-url:
|
||||
defaultZone: http://localhost:8001/eureka/
|
||||
registry-fetch-interval-seconds: 10
|
||||
zuul:
|
||||
sensitive-headers: #默认会过滤Cookie,Set-Cookie,Authorization,配置为空不过滤
|
||||
add-host-header: true #设置为true重定向是会添加host请求头
|
||||
management: #开启SpringBoot Admin的监控
|
||||
endpoints:
|
||||
web:
|
||||
@@ -21,3 +22,6 @@ management: #开启SpringBoot Admin的监控
|
||||
endpoint:
|
||||
health:
|
||||
show-details: always
|
||||
logging:
|
||||
level:
|
||||
org.springframework.cloud.gateway: debug
|
||||
|
||||
@@ -15,6 +15,10 @@
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
|
||||
|
||||
@@ -29,6 +29,10 @@
|
||||
<groupId>com.macro.mall</groupId>
|
||||
<artifactId>mall-mbg</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-security</artifactId>
|
||||
|
||||
@@ -29,6 +29,10 @@
|
||||
<groupId>com.macro.mall</groupId>
|
||||
<artifactId>mall-mbg</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
|
||||
|
||||
Reference in New Issue
Block a user