Basic Node and Express - Use the .env File

Tell us what’s happening:
The question says to convert the “Hello json” string to “HELLO JSON” by check the value in the MESSAGE_STYLE environment variable. I have done everything and the app is working but the test cases are not passing.

Your project link(s)

solution: boilerplate-express - Nix (beta) Repl - Replit

Your browser information:

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

Challenge: Basic Node and Express - Use the .env File

Link to the challenge:

This code doesn’t return the required message


app.get('/json', (req,res) => {
  console.log( `${req.method} ${req.path} - ${req.ip}`  );
  next();
})

Also, you need to check the environment variable inside of your GET callback because the tests work by changing the environment variable value while your app is running.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.