freecodecamp test link failed to verify my code.
Here is the code im executing.
var express = require(‘express’);
var app = express();
console.log(“Hello World”);
app.use("/public", express.static(__dirname + “/public”));
console.log(__dirname + ‘/public’);
app.get(’/’, function(req, res) {
var absolutePath = __dirname + ‘/views/index.html’;
res.sendFile(absolutePath);
});
app.get(’/json’, function(req, res) {
console.log(process.env.MESSAGE_STYLE);
if (process.env.MESSAGE_STYLE === ‘uppercase’){
res.json({“message”: “Hello Json”.toUpperCase()});
} else {
res.json({“message”: “Hello Json”});
}
});
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.88 Safari/537.36
Challenge: Use the .env File
Link to the challenge: