Basic Node and Express - Use the .env File

Tell us what’s happening:

Unable to understand on how to approach the problem, it says

Then, in the /json GET route handler you created in the last challenge access process.env.MESSAGE_STYLE and transform the response object’s message to uppercase if the variable equals uppercase . The response object should either be {"message": "Hello json"} or {"message": "HELLO JSON"} , depending on the MESSAGE_STYLE value. Note that you must read the value of process.env.MESSAGE_STYLE inside the route handler, not outside of it, due to the way our tests run.

It sounds like the challenge is to transform the value, but MESSAGE_STYLE is not a function. how can I use to transform the value?
###Your project link(s)

solution: https://3000-freecodecam-boilerplate-h8fxgdr54da.ws-eu117.gitpod.io

Your browser information:

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

Challenge Information:

Basic Node and Express - Use the .env File

Create a .env file in the root of your project directory, and store the variable MESSAGE_STYLE=uppercase in it.

Once you’ve done this, you do not need to modify this in any way.
Instead, in your /json route handler, you create a conditional statement which returns a response object, depending on the value of the MESSAGE_STYLE variable.
The conditional statement should return {"message": "HELLO JSON"} if the value of MESSAGE_STYLE is uppercase or {"message": "Hello json"} if not.

Following in my updated code

let express = require('express');
let app = express();
let process = require('dotenv').config();

app.get("/", function(req,res){
    res.sendFile(__dirname + "/views/index.html")
})

app.use("/public", express.static(__dirname + "/public"))
app.get("/json", function(req,res){
    if(process.env.MESSAGE_STYLE === 'UPPERCASE'){
        res.json({"message": "Hello JSON"});
    }else{
        res.json({"message": "Hello json"});
    }
})
console.log(process.env.MESSAGE_STYLE);
 module.exports = app;

the console.log gives me undefined, seems like it can read process but nothing on process called env, so I did console.dir and it gives
{ parsed: { MESSAGE_STYLE: 'uppercase' } }

You don’t need to declare a variable here. You can remove everything from this line up to and including the =

This is not the correct value for your variable. (Perhaps counterintuitively) it should be in lower case.

This is not the specified response if the condition is met. Please check the capitalisation of the string.

This is new for me, using require without declaring a variable and assigning to it

Yes, often you would create a variable when using require, but not in this case.

MORE INFO: