此模块提供完整的 Node-RED 应用程序,内置运行时和编辑器组件。
此模块公开的 API 允许它嵌入到另一个 Node.js 应用程序中。
httpAdmin : ExpressApplication
编辑器管理 API 的 Express 应用程序
httpNode : ExpressApplication
HTTP 节点的 Express 应用程序
server : HTTPServer
运行时使用的 HTTP 服务器
设置
这提供了对运行时内部设置模块的访问。
init(httpServer, userSettings)
初始化 Node-RED 应用程序。
参数
名称 | 类型 | 描述 |
---|---|---|
httpServer |
服务器
|
要使用的 HTTP 服务器对象 |
userSettings |
对象
|
包含运行时设置的对象 |
start() → {Promise}
启动 Node-RED 应用程序。
返回
- 类型
-
Promise
- 完成时解析
stop() → {Promise}
停止 Node-RED 应用程序。
调用后,在 Node.JS 进程重新启动之前,Node-RED 不应重新启动。
返回
- 类型
-
Promise
- 完成时解析
version() → {String}
获取运行时版本
返回
- 类型
-
字符串
- 运行时版本