2Zuul 路由前缀 · SpringCloud微服务实战 · 看云

2.路由前缀

导航

本节代码地址


比如我们想给将通过网关的接口统一设置一个url前缀,可以使用如下配置

zuul:
  prefix: /api

那之前的接口在想请求simple 的数据,就必须带上/api,localhost:8678/simple/hello要变成localhost:8678/api/simple/hello
60672f4ded2f0936f7b1b0c2ac2622bf_MD5.webp