Answers for "declear dotenv in node js"

6

node dotenv

require('dotenv').config();

console.log(process.env.MY_ENV_VAR);
Posted by: Guest on October-07-2020
0

dotenv in node js

This is used to add a specific path to locate the .env file if we use like this 
.config() then this is finding .env file in our cwd - current working directory.


require('dotenv').config({ path: '/custom/path/to/.env' })
Posted by: Guest on February-11-2022

Python Answers by Framework

Browse Popular Code Answers by Language