Basic Node and Express - Use the .env File

Tell us what’s happening:

this is my code let express = require(‘express’);

let app = express();

app.get("/json", function (req,res)
{
let response;
  if (process.env.MESSAGE_STYLE==='uppercase') {
    response = "Hello json".toUpperCase();
  }
  else {
    response = "Hello json";
  }
  res.json({
      "message": response
  });
  
});

(i tried removing the let response too im just trying anything really) for some reason this wont pass, also it wont show for more than a second on the live browser before showing not found on the browser. This is on gitpod. what do i do? ive tried retsrating the server too

###Your project link(s)

solution: https://3000-freecodecam-boilerplate-84dklmgfkyq.ws-us114.gitpod.io

Your browser information:

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

Challenge Information:

Basic Node and Express - Use the .env File

please read the section about dotenv and apply that


require(‘dotenv’).config();

let express = require(‘express’);
let app = express();

app.get(“/json”, function (req,res)
{
let response;
if (process.env.MESSAGE_STYLE===‘uppercase’) {
response = “Hello json”.toUpperCase();
}
else {
response = “Hello json”;
}
res.json({
“message”: response
});

});

ok so i tried that and its still not working

are you using curly quotes or that is only an issue with copy pasting?

also please show your .env file

oh it was actually a typo in my .env file thank you so much for your help and patience!