Hello everyone.
I’ve just read other’s issues on this challenge and none of them help.
I can’t find the problem.
• environment variable is set
• everything works when I test them on Replit.com
• links are correct
BUT
I can not pass! WHY?
My Solution on replit
var express = require('express');
var app = express();
let mySecret = process.env['MESSAGE_STYLE'];
app.get("/", (req, res) => {
app.use('/public', express.static(__dirname + '/public'));
res.sendFile(__dirname + '/views/index.html');
});
let response = {};
app.get("/json", (req, res) => {
if (mySecret === "uppercase") {
response["message"] = "Hello json".toUpperCase();
} else {
response["message"] = "Hello json";
}
res.json(response);
});
My browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36
Challenge Name: Use the .env File
Link to the challenge: