通过gateway集成swagger3微服的开发API接口文档
目录如下

用户微服(userServer)和管理后台微服(magServer)配置的swagger3是一样的
两个网关路由微服application-dev.yml代码内容如下
server:
#微服端口
port: 8085
spring:
main:
web-application-type: reactive
cloud:
config:
discovery:
enabled: true
label: master
gateway:
enabled: true #开启网关
discovery:
locator:
enabled: true #开启自动路由,以服务id建立路由,服务id默认大写
lower-case-service-id: true #服务id设置为小写
routes:
- id: /user-page/**
uri: lb://USER-SERVER
predicates:
-
本文介绍如何在Spring Cloud环境中通过Gateway集成Swagger3,实现微服务API接口文档的统一聚合。用户微服和管理后台微服的Swagger3配置相同,主要涉及配置文件、依赖添加和两个特定配置类的创建,最终可以通过网关路由访问所有接口文档。
订阅专栏 解锁全文

被折叠的 条评论
为什么被折叠?



