Need help with dotenv challenge

Tell us what’s happening:

I followed all the instructions for making the api endpoint but it doesn’t pass the test

Your code so far

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

const response = “Hello Json”

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


Screen Shot 2020-07-27 at 10.10.23 AM

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:

Hey @spikyron,

Did you give the challenge, a LIVE APP link?

Hey! I’ve been stuck on the same challenge as well. It’s the only challenge in the Basic Node and Express set that I have yet to pass, and it’s been frustrating me.

I’m supplying a screenshot showing my code and its result. As you can see, I’ve gotten it to do what it’s supposed to do on Glitch, but when I tried to submit the live app link, it wouldn’t accept my challenge either.

Edited to add: After posting this, I forked a clean fork for the challenges such that the ONLY thing on the app was the completed .env challenge, and submitted that fork to the evaluator, and it still didn’t take!

Here is the fork if you’re interested:

I actually passed the challenge , its really weird

I just used the code from the previous challenge and ended up with something similar, then it let me pass

Programmer frustrations, after you pass you wonder why, but im really sorry i dint manage to take a screenshot of the code