Ros*_*oss 2 azure urlparse node.js azure-functions
我正在学习如何使用 Azure 函数,对它还很陌生。我有一个用 NodeJs 编写的 httptrigger Azure 函数。我正在考虑如何从 httptrigger 函数 URL 解析数据并在我的代码中使用它的逻辑。想对此提出一些建议吗?
简单来说,
请参阅自定义 HTTP 端点中的示例。
您可以route在以下位置定义function.json:
"route": "products/{category:alpha}/{id:int?}"
Run Code Online (Sandbox Code Playgroud)
然后从以下位置获取 URL 部分context:
var category = context.bindingData.category;
var id = context.bindingData.id;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3288 次 |
| 最近记录: |