How to work with ENV when creating a template?
To publish templates, you need to know how to configure ENV so that the end user does not have to do extra work
Get a link to the service (UI/Node-RED)
In order to get a link to UI/Node-RED after downloading template, you need to write $service-name
in value. For example, we have two services: marketingUI
and marketingNR
. For the UI, we need to get a link to Node-RED, so in ENV for User interface, add a new env with value $marketingNR
After downloading the template, we get the following result
Add a connection to MongoDB
The database is used in Node-RED so we can dynamically create all ENVs to connect to MongoDB. For this, by analogy, as described above, need to add ENV $db-name
As a result, we will receive in Node-RED a list of ENVs for connecting to MongoDB.
AIBOTDB-MONGO-HOST-NAME
AIBOTDB-MONGO-DB-NAME
AIBOTDB-MONGO-USER-NAME
AIBOTDB-MONGO-PASSWORD