Closed dmi3y closed 3 years ago
Hi Dmitry,
Sorry for the late reply.
dotenv-flow actually doesn't rely on process.env.NODE_ENV
, it just uses it as a default value for options.node_env if you don't provide it explicitly.
So if you want to use i.e. APP_ENV
environment variable instead of NODE_ENV
, you can do it like this:
require('dotenv-flow').config({
node_env: process.env.APP_ENV || 'development'
});
Hi Dmitry,
Sorry for the late reply.
dotenv-flow actually doesn't rely on
process.env.NODE_ENV
, it just uses it as a default value for options.node_env if you don't provide it explicitly.So if you want to use i.e.
APP_ENV
environment variable instead ofNODE_ENV
, you can do it like this:require('dotenv-flow').config({ node_env: process.env.APP_ENV || 'development' });
Perfect! Thanks!
I'm using NextJs with dotenv-flow and using non standard environments as
staging
andedge
.When trying to load my
.env.staging
or.env.edge
set of env variables withNODE_ENV=staging|edge next dev
it does "normalize"NODE_ENV
variable to bedevelopment
instead, and giving following warning: see additional explanation hereIt would be nice to have ability to provide alternative option so dotenv-flow can be used with it e.g.
APP_ENV=staging next dev
If this sounds as a good idea I'll be happy to work on it.