Custom env file name
See original GitHub issueHello, as written in docs:
Note: By default the package look for a .env file in the path that you have started your server from. If you want to specify another path for your .env file, use the second parameter of ConfigModule.load().
I’d like to set different .env file for Test module. When i’m doing
ConfigModule.load(
path.resolve(__dirname, 'config/*.{ts,js}'),
{
path: 'mypath/.env.test',
}
)
I’m getting
error TS2345: Argument of type ‘{ path: string; }’ is not assignable to parameter of type ‘ConfigOptions’.
So, how should options
parameter looks like?
Also is there a possibility, to extend in .env.test
file values from default .env
file, so wouldn’t i have to duplicate code?
Thanks
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
How to customize Node.js .env files for different environment ...
By default, custom-env picks the .env file for your dev stage. However, to customize for a different stage, add the name as a...
Read more >Customizing Node.js .env files - LogRocket Blog
Learn how to configure a Node.js application via environment variables and customize an .env file with new environment variables.
Read more >optionally change the file name of ".env" · Issue #20 - GitHub
I would like to the ability to optionally override the file which you load env. _loadEnv: function(fileName) { if (!
Read more >node.js - Naming convention for environment variables files?
I was just wondering if there was any standardized convention for .env environment variable files. If I had ...
Read more >How To Deal With Custom .env Files in Next.js
First, create a build.sh file in the root directory of your project as follows: Here, .env.local is removed and .env.production is replaced by ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
👍 Thanks!
emmmm it works now. just filename. ┓( ´∀` )┏