Hi mgaussie, check whether the value for the ENV variable has been saved correctly under Server Connect Settings -> Environment for the Staging target.
If a new project target is created after the ENV variables have already been created with their values, then these values get copied over to the new project target.
Hi @guptast guptast, I don’t have anything in SC Settings > Environment, I assumed as for the development target it automatically outputs ‘development’ and then for remote server it outputs ‘production’ it would automatically set the NODE_ENV to the environment usage selected in the target?
Even though I do have an output without manually setting the environment, do I need to do this manually?
Sorry, I didn’t understand the setup with NODE_ENV. Is it an ENV variable, setup under Globals -> Input -> $_ENV?
The environment variables are defined under Globals -> Input -> $_ENV. The values for these variables are defined under SC Settings -> Environment for each project target.
So you can see here the NODE_ENV is outputting automatically as ‘development’. Is it fair to assume that when a target is set to staging, or production that Wappler should also automatically handle this by replacing development with the usage setting from the Project Settings?
It seems more like an output of the Dockerfile. I don’t know how the environment variables defined in this file are accessible within your APIs, if these are available via the API component.
In my setup, I define the ENV variables manually under Globals along with their values for each project target under the SC Settings. This way, the ENV variables are accessible in the APIs and their values can be different, if required, for different tagrets.