gpt4 book ai didi

javascript - 如何在节点红色中设置环境变量?

转载 作者:行者123 更新时间:2023-11-30 20:10:13 26 4
gpt4 key购买 nike

我是使用 Node-Red 进行开发的新手,正在寻找一种方法将值集作为环境变量导入到我的一个流程中。

非常感谢有关此的任何帮助。

最佳答案

自 node-RED 版本 0.19 起,将环境变量导入流中变得更加容易。

来源:https://nodered.org/blog/2018/08/14/version-0-19-released

示例:读取环境变量 COMPUTERNAME,使用更改节点:

[{"id":"d17299e5.9ff148","type":"tab","label":"Flow 5","disabled":false,"info":""},{"id":"d66f687a.d01248","type":"change","z":"d17299e5.9ff148","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"COMPUTERNAME","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":140,"wires":[["67cb1bc6.0b3724"]]},{"id":"578fe08e.8f056","type":"inject","z":"d17299e5.9ff148","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":140,"wires":[["d66f687a.d01248"]]},{"id":"67cb1bc6.0b3724","type":"debug","z":"d17299e5.9ff148","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":580,"y":140,"wires":[]}]

enter image description here

关于javascript - 如何在节点红色中设置环境变量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52484943/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com