Ref:
https://www.npmjs.com/package/dotenv
Install
npm install dotenv
Read env file
// server.js
console.log(`Your port is ${process.env.PORT}`); // undefined
const dotenv = require('dotenv');
dotenv.config();
console.log(`Your port is ${process.env.PORT}`); // 8626