I have created the .env file as suggested in the task description. But the environment variable when used using process.env.MESSAGE_STYLE gives me undefined value.
Your code so far
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
If you are working locally, you will need the dotenv package. It loads environment variables from your .env file into process.env. The dotenv package has already been installed, and is in your project’s package.json file. At the top of your myApp.js file, add require('dotenv').config() to load the environment variables.
Thanks for the suggestion about requiring (‘dotenv’).config(). I am using the gitpod to perform tasks in every section of this course. I added the require(‘dotenv’).config() in myApp.js file and still the code does not work as intended. could you please guide?
Thank you for guiding me with this issue. But the line " module.exports = app;" was already present when I started the gitpod session. And removing that line gave me error saying that it could not find the package “GitHub - freeCodeCamp/fcc-express-bground-pkg: Backend boilerplate node express - package test”. Below is the screenshot that shows that the .env file is in the root folder.