gateway配置

This commit is contained in:
bunny 2025-05-27 13:02:40 +08:00
parent 7960a6f879
commit 0bbe4ec39e
3 changed files with 20 additions and 1 deletions

View File

@ -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>

View File

@ -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/**

View File

@ -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