This is where I got stuck, I don’t know what’s wrong in my code but when I paste the link to the solution it keeps appearing this- // running tests The response of the endpoint
/json
should change according to the environment variable
MESSAGE_STYLE
// tests completed
Your code so far
Here is the code -
app.get('/json',(req,res)=>{
if (process.env.MESSAGE_STYLE==="uppercase") {
res.json({"message":"HELLO JSON"});
} else {
res.json({"message":"hello json"});
}
})/** 5) serve JSON on a speci
The link to the code has been mentioned above.
Please help.
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36.
I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
Please use the “preformatted text” tool in the editor (</>) to add backticks around text.
Not really sure what is going on I get a CORS block with your project. But if I remix it and add the variable value it works. Not sure but it might be the name of the project (trailing - in the name maybe).
Try renaming the project first. Click the top-left button and in the input at the top, you can write a new name. If that doesn’t work, try remixing it. Again click the top left button and then click “Remix Project”.