It would be great if environment variables could be loaded on server start and read for:
DB connection files
APIs (including S3 connectors)
This would include changing how getDbConnection and setDbConnection are implemented so they can evaluate dynamic expressions in the json connection file.
Great for when you are just using Wappler to build, but you want to handle deployment manually.
Thanks Ken! I am not using docker to deploy for this project though. I only use docker at the moment to develop.
Indeed to actually load them is not the problem. Once I have deployed to the servers I just use whatever the hosting provider has for that.I can work around not having them in UI. I was referring to make it easier via UI for the local node server that Wappler has.
What I really miss is being able to use them in the json connection files so that I can use the same connection file for all the environments I use (local machine, staging and production).
Right now what I have to do is push to remote git with the remote db connection details. Then revert to the local docker connection details and add to .gitignore so I don’t overwrite it when deploying again.
Nono, I mean Wappler’s json connection file. The one in /app. To set an environment variable inside the app/modules/connections/db.json so I can set the appropriate variables in the server an use the same connection file name for all environments.
For my use case it would be enough to be able to add environment variables in the target that are loaded on server start. Plus the picker you mention of course.
Just to mention that this approach is not compatible with the db manager. If these environment variables could be set in the target they could be read by the db manager.
I set up SC Connection with the variables then I set Direct Connection with the real values and the SC connection variables get overwritten with the real values.
As a workaround I use an external editor to edit manually the files. So just so you guys know.