Tell us what’s happening:
Describe your issue in detail here.
Been “Spinnin’ my Wheels” on this challenge most of the day. Have tried everything “every which way but loose.” Have no idea what I’m doing wrong. Could someone please give me the right answer so I can just Move On. Your project link(s)
If you are using replit for this challenge you dont use an .env file because replit doesnt use them go to the secrets tab add the variable name and the corresponding value click add then you can click a link and replit will automatically add the code into your file so you can use the variable.
This code won’t work because you send the JSON response and then have a conditional statement which effectively tries to send it again.
Also, res.json.toUpperCase() isn’t valid code, as it should take an object, not a method.
So, have a conditional statement which sends a single res.json depending on the value of the env variable. You can either explicitly send ‘HELLO JSON’ or have the message stored in a variable and use toUpperCase() within the res.json object.