Tell us what’s happening:
Describe your issue in detail here.
Hello guys.
I can’t finish this challenge. Read a lot of help topics, but still can’t recognize the problem. I’ve got an error message: The response of the endpoint /json should change according to the environment variable MESSAGE_STYLE.
Can someone please check my code:
If you want to share your working code, it’s better not to post screenshots.
Also the link to your repl code should be: boilerplate-express - Replit
(The url in your address bar when you’re on your repl).
The link you shared is the live link for submitting your code for FCC testing.
That said, your code is now correct. Perhaps you haven’t correctly added your environment variable to your Secrets tab in repl?
I can’t see an env file in your repl. That’s good though, because you shouldn’t have one. In replit, your environment variables are stored in your Secrets tab.
In either case, you should be storing the variables as:
When you open up your Secrets tab, you can view environment variables which you have already stored and/or add new variables.
You should add them exactly as the NODE_ENV variable is added here (i.e. no additional syntax such as brackets, quote marks etc).
This variable will then be available in your app as process.env.NODE_ENV.
You would ordinarily create a .env file and add this variable as NODE_ENV=test, but this is how replit chooses to handle environment variables, so that they are not publicly visible.
All of this is also explained in some detail in the challenge instructions which you linked earlier.