✨ gateway配置
This commit is contained in:
parent
7960a6f879
commit
0bbe4ec39e
|
@ -65,6 +65,10 @@
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-gateway</artifactId>
|
<artifactId>spring-cloud-starter-gateway</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
spring:
|
||||||
|
cloud:
|
||||||
|
gateway:
|
||||||
|
routes:
|
||||||
|
- id: order-route
|
||||||
|
uri: lb://service-order
|
||||||
|
predicates:
|
||||||
|
- Path=/api/order/**
|
||||||
|
- id: product-route
|
||||||
|
uri: lb://service-product
|
||||||
|
predicates:
|
||||||
|
- Path=/api/product/**
|
|
@ -2,8 +2,11 @@ server:
|
||||||
port: 8888
|
port: 8888
|
||||||
|
|
||||||
spring:
|
spring:
|
||||||
|
profiles:
|
||||||
|
include:
|
||||||
|
- route
|
||||||
application:
|
application:
|
||||||
name: gateway
|
name: gateway
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
server-addr: 192.168.3.150:8848
|
server-addr: 192.168.3.150:8848
|
||||||
|
|
Loading…
Reference in New Issue