krakend 的串行proxy
krakend 的串行请求主要解决,接口多次调用的问题,解决接口链式调用的问题
一张参考图
参考配置
- 配置
"endpoint": "/hotel-destinations/{id}",
"backend": [
{ <--- Index 0
"host": [
"https://hotels.api"
],
"url_pattern": "/hotels/{id}"
},
{ <--- Index 1
"host": [
"https://destinations.api"
],
"url_pattern": "/destinations/{resp0_destination_id}"
}
],
"extra_config": {
"github.com/devopsfaith/krakend/proxy": {
"sequential": true
}
}
- 简单说明
{resp0_XXXX} 0是按照请求顺序的索引 XXXX 是对应请求的内容信息