刚刚开始使用 azure 函数。我将它用作 IoT 设备的 httptrigger。
我正在尝试设置一个功能,该功能适用于来自多个 IoT 设备的 httptrigger 请求 - 因此我不必为每个设备设置一个功能。所以理想情况下,在我的 c# 文件中,我会有这样的东西:
DeviceClient deviceClient;
string iotHubUri = "myhub";
string deviceName = "something dynamic here that changes with device";
string deviceKey = "something dynamic here that changes with device";
Run Code Online (Sandbox Code Playgroud)
然后,我想让我的函数 url 看起来像这样:
"https://<functionapp>.azurewebsites.net/api/<function>/{device_id}?code=xxxxx"
Run Code Online (Sandbox Code Playgroud)
其中 device_id 是 IoT 设备 ID。
我不确定如何首先将 c# 文件中的引用设置为动态,以及如何让 url 看起来像我想要的那样。
一些帮助将不胜感激。谢谢
是否可以根据页面路径在我的布局模板中设置 jade 条件?是否有页面路径变量?我正在寻找做这样的事情:
if page = "/about"
link(rel='stylesheet', href='css/about')
else
link(rel='stylesheet', href='css/main')
Run Code Online (Sandbox Code Playgroud)
这是布局模板的一部分。我在哪里以及如何定义变量来驱动它?