当前位置: 首页 > news >正文

gateway 网关 路由新增 (已亲测)

问题:

   前端通过gateway调用后端接口,路由转发失败,提示404 not found

排查:

   使用 { "href":"/actuator/gateway/routes", "methods":[ "POST", "GET" ] } 命令查看路由列表,确实缺少路由信息

curl -v  http://127.0.0.1:9090/actuator/gateway/routes  >> 123.txt

输出到 123.txt 文件

处理方式:
   1、 手动刷新

      { "href":"/actuator/gateway/refresh", "methods":[ "POST" ] }

   2、 手动添加

      { "href":"/actuator/gateway/routes/route-id-1", "methods":[ "POST", "DELETE", "GET" ] }

官方说明:
 

To create a route definition, make a POST request to /gateway/routes/{id_route_to_create} with a JSON body that specifies the fields of the route (see Retrieving Information about a Particular Route).

To delete a route definition, make a DELETE request to /gateway/routes/{id_route_to_delete}.

官网地址:
Spring Cloud Gateway

操作截图:

http://www.dtcms.com/a/231334.html

相关文章:

  • HarmonyOS 实战:给笔记应用加防截图水印
  • EMCC 13c 报错 “Metrics Global Cache Blocks Lost is at XXX“ 解决
  • 大语言模型备案与深度合成算法备案的区别与联系
  • yoloe优化:可支持点提示进行检测分割
  • Python训练第四十四天
  • Windows系统下npm报错node-gyp configure got “gyp ERR“解决方法
  • Kafka消息队列笔记
  • 10. MySQL索引
  • Windows系统工具:WinToolsPlus 之 SQL Server Suspect/质疑/置疑/可疑/单用户等 修复
  • ​BEV和OCC学习-3:mmdet3d 坐标系
  • Spark实战能力测评模拟题精析【模拟考】
  • webpack打包学习
  • Webpack性能优化:构建速度与体积优化策略
  • 6.4本日总结
  • 大数据-278 Spark MLib - 基础介绍 机器学习算法 梯度提升树 GBDT案例 详解
  • Three.js进阶之音频处理与展示
  • Apache APISIX
  • 多线程爬虫使用代理IP指南
  • 查找 Vue 项目中未使用的依赖
  • PR基本概念——2025填空题
  • JDK 8 到 JDK 24 新特性大全
  • 猎板硬金镀层厚度:新能源汽车高压系统的可靠性基石
  • WebFuture:启动数据库提示: error while loading shared libraries: libaio.so.1问题处理
  • 基于SpringBoot+Vue的在线音乐网站系统
  • Manus AI 现在可以生成短片了
  • 使用 systemctl 实现程序自启动与自动重启
  • 嵌入式分析利器:DuckDB与SqlSugar实战
  • Webpack搭建本地服务器
  • Solidity 开发指南:构建你的第一个 DApp
  • 《校园生活平台从 0 到 1 的搭建》第一篇:创建项目与构建目录结构