server:
port: 8080
spring:
application:
name: test-gateway
cloud:
nacos:
discovery:
server-addr: localhost:8848
gateway:
discovery:
locator:
enabled: false
#是否开启网关
enabled: true
routes:
- id: test-order-route
#目标微服务的请求地址和端口
uri: lb://test-order
predicates:
- Path=/order/*
订单服务配置
server:
port: 8081
spring:
application:
name: test-order
cloud:
nacos:
discovery:
server-addr: localhost:8848
访问地址
http://127.0.0.1:8080/order/queryOrderList