wso2 - 将参数传递给 WSO2 AM 后台 api
问题描述
我正在实施 WSO2 AM,但我有一些疑问。我想为我目前拥有的所有服务实现一个 api 网关。
(如果您认为有更容易实现的开源网关 api 也会有所帮助)
端点位于带有 express 的 NodeJS 中。它们具有以下格式:
http://localhost:3000/x/x1/:param1/:param2
http://localhost:3000/x/x2/:param1/:param2/:param3
我的想法是创建一个具有以下格式的端点的 wn wso2 AP api:
wso2 中生成的 api 将是:
然后作为资源获取添加x1和其他参数,问题是我不知道如何添加x1和参数以便终点是
解决方案
在 API Manager 中,以下是 API 的公开方式。
您拥有具有以下上下文和资源模式的后端服务。
http://localhost:3000/ {context}/{resource}/{params...}
http://localhost:3000/x/x1/ ...
http://localhost:3000/x/x2/ ...
应添加与后端服务同名的资源。
{动词} x1/{param1}/{param2}
路径参数应以上述格式提供。
此 API 的后端端点应提供如下。
调用 api 时,网关会将资源和参数附加到后端端点。
https://localhost:8243/xapi/1.0.0/x1/param1/param2 ==> http://localhost:3000/x/x1/param1/param2
推荐阅读
- python-3.x - mkvirtualenv virt 命令认为 virt 目录已经存在
- python - 有没有可能制作一个可以同时滚动和瞄准的游戏?
- excel - 有没有更好的方法在 Excel 中每次迭代将数据存储在后续单元格中?
- usb - 未绑定的 USB 设备在 linux 上自动绑定
- azure - 使用 Powershell 发布到 WebApp 虚拟目录
- c# - 无法侦听前缀“http://IPAddress:Port/”,因为它与机器上的现有注册冲突
- php - 在 phpMailer 中动态设置电子邮件地址
- css - 需要删除 React-Bootstrap 列内的两个元素之间的空间
- c# - 当 TransferMode == Automatic 时定义 ASCII 传输的 WinSCP .NET 程序集自定义列表
- python - 检测数据框的所有更改