Facing issue with Node and Express related exercise.
Excercise: Use the .env File
Below is the code present in myApp.js in replit:
let express = require('express');
let app = express();
const path = require('path');
app.listen(3001)
var response;
//console.log(.env)
const mySecret = process.env['MESSAGE_STYLE']
if (mySecret === "uppercase") {
response = "Hello Json".toUpperCase();
} else {
response = "Hello json";
}
app.get("/json",(req, res)=>{ res.json({
message:response
});})
Issue:
Content in the secret file is intact , able to see the excepted result as well.
But the solution is not being accepted and the test cases are failing.
Your project link(s) : boilerplate-express - Replit
solution: boilerplate-express - Replit
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36
Challenge Information:
Basic Node and Express - Use the .env File