i have multiple environment files and importing them like this
ConfigModule.forRoot({
isGlobal: true,
validationSchema: Joi.object({
...
}),
envFilePath: [
'.env',
process.env.NODE_ENV !== 'production'
? `.env.${process.env.NODE_ENV}`
: '',
],
})
My .env.test file have to use the variables from .env and replace it. i mean the results below.
After i seperate my env file. and console log DATABASE_URL the variable
mongodb://${MONGO_USERNAME}:${MONGO_PASSWORD}@${MONGO_HOST}/${MONGO_DATABASE}
But when i put DATABASE_URL inside .env instead of .env.test variables inside of DATABASE_URL renders.
How can i solve this? Thanks