Skip to content

Commit a777981

Browse files
committed
Some more doc updates
1 parent 4a99829 commit a777981

File tree

3 files changed

+36
-4
lines changed

3 files changed

+36
-4
lines changed

docs/user-guide/environment-variables.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ instances of the Subflow can then be customised for those particular types.
8888

8989
Environment variables can be set at the flow or group level. This is done in the appropriate tab in the edit dialog for the flow or group.
9090

91+
### Global environment variables
92+
93+
*Since [Node-RED 3.1](/blog/2023/09/06/version-3-1-released#global-environment-variables)*
94+
95+
Environment variables can be set at a global level within the editor. This is done in the User Settings dialog.
96+
97+
9198
### Accessing nested environment variables
9299

93100
When accessing an environment variable in a subflow, Node-RED will search the
@@ -134,6 +141,10 @@ The following environment variables can be used to access this information for a
134141
- `NR_GROUP_NAME` - the Name of the containing group
135142
- `NR_FLOW_ID` - the ID of the flow the node is on
136143
- `NR_FLOW_NAME` - the Name of the flow the node is on
144+
- `NR_SUBFLOW_NAME` - the Name of the containing subflow instance node (*since Node-RED 3.1*)
145+
- `NR_SUBFLOW_ID` - the ID of the containing subflow instance node (*since Node-RED 3.1*)
146+
- `NR_SUBFLOW_PATH` - the Path of the containing subflow instance node (*since Node-RED 3.1*)
147+
137148

138149
Note that while the IDs generated by Node-RED are guaranteed to be unique, the names are not. If a node, flow or group does not have a given name, the corresponding environment variable will be an empty string. If a node is not part of a group, its group id environment variable will also return an empty string.
139150

docs/user-guide/runtime/configuration.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,24 @@ httpStatic
9191
served from the top level url, `/`. When this property is used, `httpAdminRoot` must
9292
also be used to make editor UI available at a path other than `/`.
9393

94+
This property can also be set as an Array to support multiple static directories, each
95+
with its own set of options. The options include the path to the local directory to serve
96+
content from, the root url to serve them from and an optional custom middleware function.
97+
98+
For example:
99+
100+
httpStatic: [
101+
{
102+
path: '/opt/static/',
103+
root: '/private/',
104+
middleware: myCustomHttpMiddleware
105+
}
106+
]
107+
94108
*Standalone only*.
95109

110+
111+
96112
httpStaticAuth
97113
: enabled HTTP Basic Authentication on the static content. See `httpAdminAuth` for format.
98114

@@ -257,6 +273,10 @@ functionGlobalContext
257273
functionExternalModules
258274
: if set to `true`, the Function node's Setup tab will allow adding additional modules that will become available to the function. See [Writing Functions](../writing-functions#using-the-functionexternalmodules-option) for more information. Default: `false`.
259275

276+
functionTimeout
277+
: Function Nodes - the default timeout, in seconds, to apply to newly configured Function nodes.
278+
Default: 0 - meaning no timeout.
279+
260280
debugMaxLength
261281
: Debug Nodes - the maximum length, in characters, of any message sent to the
262282
debug sidebar tab. Default: 1000

docs/user-guide/writing-functions.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,12 +459,13 @@ The modules are automatically installed under `~/.node-red/externalModules/` whe
459459

460460

461461

462+
### Handling a Timeout
462463

464+
*Since Node-RED 3.1.0*
463465

464-
465-
466-
467-
466+
It is possible to set a timeout for the function node on the Setup tab. This value,
467+
in seconds, is how long the runtime will allow the Function node to run for before
468+
raising an error. If set to 0, the default, no timeout is applied.
468469

469470
***
470471

0 commit comments

Comments
 (0)