Basic Node and Express - Use the .env File

Tell us what’s happening:

First i created a file named .env, then i stored inside: MESSAGE_STYLE=uppercase
This is the function used-
app.get(“/json”,
(req, res) => {
if (process.env.MESSAGE_STYLE === “uppercase”) {
res.json({ “message”: “Hello json” });
}
else {
res.json({ “message”: “HELLO JSON”});
}
})
module.exports = app;
gitpod url: https://3000-freecodecam-boilerplate-yq0d1r4at8e.ws-us115.gitpod.io

But still the test cases are not passing.

Your code so far

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36

Challenge Information:

Basic Node and Express - Use the .env File

have you tried to do this yet?

At the top of your myApp.js file, add require('dotenv').config() to load the environment variables.

require(‘dotenv’).config();
app.get(“/json”,
(req, res) => {
if (process.env.MESSAGE_STYLE === “uppercase”) {
res.json({ “message”: “Hello json” });
}
else {
res.json({ “message”: “HELLO JSON”});
}
})

still not working

the logic is reversed?
if the variable is uppercase you should return all uppercase?

thank you , now its running
the issue was including- require(‘dotenv’).config();