✨ gateway配置
This commit is contained in:
parent
7960a6f879
commit
0bbe4ec39e
|
@ -65,6 +65,10 @@
|
|||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-gateway</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</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
|
||||
|
||||
spring:
|
||||
profiles:
|
||||
include:
|
||||
- route
|
||||
application:
|
||||
name: gateway
|
||||
cloud:
|
||||
nacos:
|
||||
server-addr: 192.168.3.150:8848
|
||||
server-addr: 192.168.3.150:8848
|
||||
|
|
Loading…
Reference in New Issue