Tell us what’s happening:
Basic Node and Express - Use the .env File
This is where I got stuck, I don’t know what’s wrong in my code but when I paste the link to the solution it keeps appearing this- // running tests The response of the endpoint
/json
should change according to the environment variable
MESSAGE_STYLE
// tests completed
Your code so far
Here is the code -
app.get('/json',(req,res)=>{
if (process.env.MESSAGE_STYLE==="uppercase") {
res.json({"message":"HELLO JSON"});
} else {
res.json({"message":"hello json"});
}
})/** 5) serve JSON on a speci
The link to the code has been mentioned above.
Please help.
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36.
Challenge: Use the .env File
Link to the challenge:
https://www.freecodecamp.org/learn/apis-and-microservices/basic-node-and-express/use-the-.env-file

