I have the following directory structure:
I am using dotenv to load environment variables but its not loading them.It gives undefined
even though I have defined them in the .env file.
The code in index.js is here:
I’ve even tried the following for requiring:
require('dotenv').config();
require('dotenv').config({path:'C:UsersxuiosDesktopAirlineManagementProjectFlightsAndSearchsrc.env'});
// absolute path
require('dotenv').config({path:'FlightsAndSearchsrc.env'});
//relative path