Tell us what’s happening:
I am working locally with VS code
I don’t know why it is not passing the test if this works correctly in the brows, here is the code and the image of the result
let express = require("express");
let app = express();
require('dotenv').config()
app.use("/public", express.static(__dirname + "/public"));
app.get("/", (req, res) => {
res.sendFile(__dirname + "/views/index.html");
});
app.get('/json', (req, res) => {
let message = "Hello json"
if (process.env.MESSAGE_STYLE === "uppercase") {
return res.json({"message": message.toUpperCase()})
}
return res.status(200).json({"message": message})
})
module. Exports = app;
Here is the content of the .env file
MESSAGE_STYLE="uppercase"
And the imagen for the result
Challenge: Basic Node and Express - Use the .env File
Link to the challenge: