Basic Node and Express - Use the .env File

Tell us what’s happening:
Describe your issue in detail here.
Hi guys, please I need help with the .env file challenge …
I created the .env file and in it (the first line) in have exactly this code “MESSAGE_STYLE=uppercase” - - without the quotes.

In my “myApp.js” file, I have “app.get(”/json", (req, res) => {
res.json({
“message” : process.env.MESSAGE_STYLE=uppercase ? “Hello json”.toUpperCase() : “Hello json”
});
});"

but my code is still not updating the /json path… what am I doing wrong?
Your code so far

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:103.0) Gecko/20100101 Firefox/103.0

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

Link to the challenge:

You may want to review how to make comparisons. You are attempting to assign the value of a variable named uppercase which does not exist in your app to process.env.MESSAGE_STYLE.

1 Like

Oh! thank you, I’ve got it I should have used “===” and the “uppercase” value in the .js file should have been in quotes since it’s not in a .env file… Thank you for taking the time.