Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

npm dotenv

//In CMD
// npm i dotenv

//in JS file 
const env = require('dotenv');

const app = express();
env.config({
    path: './config/.env'
});

//use 
const PORT = process.env.PORT;
 
PREVIOUS NEXT
Tagged: #npm #dotenv
ADD COMMENT
Topic
Name
4+5 =