I have been working on this for hours and read so many forum but can’t figure out why I still get the error message.
Here is my code:
/** 1) Meet the node console. */
console.log("Hello World")
/** 2) A first working Express Server */
// app.get("/", function(req, res) {
// res.send("Hello Express");
// });
/** 3) Serve an HTML file */
app.get("/", function(req, res) {
res.sendFile(__dirname + "/views/index.html");
});
/** 4) Serve static assets */
app.use(express.static(__dirname + "/public"));
/** 5) serve JSON on a specific route */
// app.get("/json", function(req, res) {
// res.json({"message": "Hello json"});
// });
/** 6) Use the .env file to configure the app */
app.get("/json" , function(req, res) {
let message = {"message": "Hello json"};
if (process.env.MESSAGE_STYLE = "uppercase") {
message.message = message.message.toUpperCase()
}
res.json(message)
})
glitch: https://elated-eggnog.glitch.me/
it would be great if I can get some advice. I really want to get all the certification but I can’t move forward because of this.