#Change enviroment vairables with dotenv

5 messages · Page 1 of 1 (latest)

ripe edge
#

Hi,

I have to overwrite some entries in one or more .env files. If the variables has been set with the command line, it would be nice to change these, too.

Currently I use the default ConfigService from the NestJs ConfigModule and applied a custom validator with class-validator and class-transformer. I already did some transformations with these libs, but now I have to write these changes to the files.

The locations of the files are static (in a relative path context).

Is a custom ConfigService a good idee? If so, can I extend the default ConfigService?

winter delta
# ripe edge Hi, I have to overwrite some entries in one or more .env files. If the variabl...

i'm not sure if i understood you correctly, so let me know if i didn't
the nest docs mentions creating custom getter functions
perhaps this is what you are looking for?

ripe edge
winter delta
delicate vigilBOT
#

This post has been marked as resolved. :white_check_mark:
Please read through the conversation and resolution if you are having the same issue, and then re-open the post if you are still having trouble, providing as much extra information as possible.