My solution for the problem is the following:
var express = require('express');
var app = express();
const mySecret = process.env['MESSAGE_STYLE'];
let response="Hello json";
if(mySecret==="uppercase"){
response=response.toUpperCase();
}else{
response="Hello json";
}
app.get("/json", function(req,res) {
res.json({"message": response});
});
when I run the code on replit and use the domain provided to route to the “/json” the message returned is uppercase as described but I can not seem to pass the test and that’s what I am confused about.
help would be appreciated.
Your project link(s)
solution: https://replit.com/@brahamnarayan5/boilerplate-express
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36
Challenge: Use the .env File
Link to the challenge: