Tell us what’s happening:
i got to this challenge to create an program to output json response based on whether request is in uppercase or not. I have writen various program instruction yet saying the same thing
Its a bit confusing, you describe one challenge, but you give link to a different challenge. The FCC challenge has different instructions from the ones you try to accomplish. You need to put the response in upper case, if the specific environmental variable value is equal ‘uppercase’. So first you need to figure out a way to access that environmental variable and check if its value is equal to ‘uppercase’. The lesson has an explanation on how to access an environmental variable value.
Once you have the variable value and if its equal to ‘uppercase’ you should apply toUpperCase() to the response message, before you send it.
You are supposed to just export your app. And add all the methods above that.
Your file should look like:
// imports
vax x = require("foo");
// your methods
app.get()
app.post()
app.public()
// exporting the whole app with all its current methods
module.exports = app;
// You just check if the variable 'mySecret' is the same like 'mySecret' When it hase 'toUpperCase()'
if(mySecret === mySecret.toUpperCase()){
res.json({
"message": "HELLO JSON"
})
}else{
res.json({
"message": "Hello json"
})
}