Перейти до основного вмісту

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

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

how-to-work-with-env_ui-nr

After downloading the template, we get the following result

Image description

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

how-to-work-with-env_db

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

how-to-work-with-env_db_res