Tell us what’s happening:
I have implemented the code and it works fine on the Repl.it but when I paste the link for testing it says that
// running tests The response of the endpoint
/json
should change according to the environment variable
MESSAGE_STYLE
// tests completed
my actual output : {“message”:“HELLO JSON”}
also i have created the .env file and have written this inside:
MESSAGE_STYLE=uppercase Your code so far
var express = require('express');
var app = express();
app.get('/',hello);
app.get('/json',json_res);
var response="Hello json";
if(process.env.MESSAGE_STYLE==='uppercase'){
response="Hello json".toUpperCase();
}
else{
response="Hello json";
}
json_obj = {"message": response};
function json_res(req,res){
res.json(json_obj);
}
function hello(req,res){
res.send("Server is running");
}
module.exports = app;
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36.
YES THE SOLUTION GOT ACCEPTED
clicked the I’ve completed challenge button several times then got accepted.
Might be some server or network issues.
Thankyou @Sky020 for the help