Use an environment variable when running our node application and have node inherit it in process.env.
Steps tried
Set allowEnvVars to true
Added an env object with a key value pair of “ENV_FILE”: “.env.lp_dev”
From what I can see the app schema here doesn’t provide a environment variable configuration for type “node”, only thing related I can see is “nodeCLIOptions”. It seems however to be present on “window” and “exe” application types.
Does interop support this for node apps? To be clear this isn’t a web app, its a node CLI app that we auto start as part of our setup, there is no UI, hence not using it as a window.
Actual vs expected
Expected process.env to include our environment variable, which wasn’t the case.
So the only alternative here for being able to set environment variables is to use an exe type application and call the node command directly? We’ve got plenty of cases at the moment where we need to run a node app that needs to use environment variables and it sounds like the node app type is very limited- what options do we have instead of this?
Sorry for the delay. Can you provide a bit more detail about your use case and workflow here?
allowEnvVars is for web apps and enables them to access the main process env variables using glue42gd.env object. And node app started as apps should inherit these vars by default.
I encountered the same issue. Initially, I considered configuring the required properties via app-config, but later realized that using a gilding.json file with the necessary environment variables is a better approach.
For local development, setting the environment variables directly is sufficient. However, for production environments, we recommend using remoteConfig for improved security.
Important (Upgrade Limitation):
Please note that when upgrading to io.Connect Desktop 10.0, support for loading configuration via gilding.json is not available. This functionality is planned and scheduled for implementation in a future release of io.Connect Desktop.
As a result, customers who rely on gilding.json must remain on an io.Connect Desktop 9.x version and defer upgrading to v10.0 until this support is reintroduced.