Basic Node and Express - Use the .env File

Tell us what’s happening:
Why won’t this code pass the FCC tests?
It works in the browser

app.get(‘/json’, (req,res) => {
if (process.env.MESSAGE_STYLE === ‘uppercase’) {
res.json({“message” : “HELLO JSON”})
else {
res.json({“message”:“hello json”})

Your project link(s)


Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15

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

Link to the challenge:

This is not the response required by the challenge if not uppercase.

1 Like

Ahh… uppercase ‘h’… thank you!

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