使用Spring Boot将Zuul网址映射到其他网址

时间:2019-02-16 21:25:35

标签: spring spring-boot netflix-zuul

我正在使用微服务架构来开发rest API。我有每个项目的文档API。我想在 application.properties 文件中使用Zuul为不同的微服务映射不同的doc API URL,但使用通用后缀。

API Gateway URL: www.common-api.com/authservice/v2/api-docs
Micro Service URL: www.auth-api.com/v2/api-docs

API Gateway URL: www.common-api.com/userservice/v2/api-docs
Micro Service URL: www.user-api.com/v2/api-docs

想使用Zuul将API网关URL映射到微服务URL

  

application.properties

 zuul.routes.auth.path: authservice/v2/api-docs
 zuul.routes.auth.url: http://www.auth-api.com/v2/api-docs

 zuul.routes.users.path: userservice/v2/api-docs
 zuul.routes.users.url: http://www.user-api.com/v2/api-docs

我正在尝试在 application.properties 文件中使用此行,但是它不起作用。需要帮助吗?

0 个答案:

没有答案