Tell us what’s happening:
Describe your issue in detail here.
I have tried different variations, starting the course from scratch, looking up other forum posts and I still can not get past this lesson.
this is the entire code I have right now in myApp.js on Replit:
require(‘dotenv’).config()
let express = require(‘express’);
let app = express();
/* app.get(“/”, function(req, res) {
res.send(“Hello Express”);
});
*/
app.get(“/”, function(req, res) {
res.sendFile(absolutePath = __dirname + “/views/index.html”);
});
app.use(“/public”, express.static(__dirname + “/public”));
app.get(“/json”, function(req, res) {
var mySecret = process.env[‘MESSAGE_STYLE’];
if (mySecret === “uppercase”) {
res.json({“message”: “HELLO JSON”})
} else {
res.json({“message”: “Hello json”})
};
});
Your project link(s)
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