2Zuul 路由前缀 · SpringCloud微服务实战 · 看云
2.路由前缀
导航
本节代码地址
GitHub: https://github.com/xuyisu/fw-sping-cloud/tree/master/fw-cloud-gateways/fw-cloud-gateways-zuul-simple
比如我们想给将通过网关的接口统一设置一个url前缀,可以使用如下配置
zuul:
prefix: /api
那之前的接口在想请求simple 的数据,就必须带上/api,localhost:8678/simple/hello要变成localhost:8678/api/simple/hello
