Problem with the .env challenge in API and micro services certificate

Tell us what’s happening:

so I followed the instructions to make an endpoint at /json of my app

Please help, thx very much :slight_smile:
Your code so far

image
this is the .env file

and my code at app.js

var express = require(‘express’);
var app = express();

const response = “Hello Json”

app.get(’/json’, (req,res) => {
if(process.env.MESSAGE_STYLE === “uppercase”){
res.send({message: response.toUpperCase()})
}
else {
res.send({message: response})
}

})

Your browser information:

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

Challenge: Use the .env File

Link to the challenge:

1 Like

Hey there, instead of putting the response as you have, why dont manually input the message in Uppercase and the other in lowercase?
i.e

res.send({message: "HELLO JSON"})

res.send({message: "Hello Json"})

I tried your approach too but failed, the above however worked.

Try it without the quotes around uppercase in your .env file.