Basic Node and Express - Use the .env File

Tell us what’s happening:
Test Failing: The response of the endpoint /json should change according to the environment variable MESSAGE_STYLE

However, if I look at the json response does change based on my Secret.

Your project link(s)
https://boilerplate-express.disney50.repl.co/json

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

Link to the challenge:

Please post your code. (Or share it)

{"message":"HELLO WORLD"}

This is not the response required by the challenge.

See the project link minus “/json” (https://boilerplate-express.disney50.repl.co)

Can you be more specific? Do you mean changing “WORLD” to “JSON” and “World” to “json”? Because the test still doesn’t pass…

The link we need, to see your code is: boilerplate-express - Replit
(That’s the url in your address bar when you’re in your repl).

Your code is working for me and passing the challenge.

Do you have the MESSAGE_STYLE variable stored correctly in your Secrets tab in repl?

Of course, sorry: boilerplate-express - Replit

Did you get the link to see my code?

Like I said, your code is correct and passes the challenge.
The only reason it might not be passing for you is if you haven’t added the environment variable correctly to your Secrets tab in replit.

This is what the secret looks like:

How do I access the Node console after submitting? As far as I know only the DevTools console is available then:

It doesn’t seem to be possible to edit the Webview url to add “/json”?

Thanks. No errors, I’m afraid:

What is the exact url you are submitting for this particular challenge? You should be submitting the following url for this challenge.

https://boilerplate-express.disney50.repl.co/

I’m an idiot, I knew it was going to be something basic and stupid. I’ve been submitting https://boilerplate-express.disney50.repl.co/json instead of https://boilerplate-express.disney50.repl.co/. Thanks for your help.

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