Why is this not working? API and Microservices .env

Tell us what’s happening:
This is my code :
.env
MESSAGE_STYLE=uppercase

myApp.js
app.get(’/json’, function(req, res){

if(process.env.MESSAGE_STYLE === "uppercase")
      res.json({"message": "HELLO JSON"})
else 
  res.json({"message": "Hello json"})

})

Where is the error?

Challenge: Use the .env File

Link to the challenge:

Have you seen this post?

Thanks for the link
:slight_smile:

1 Like

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