Basic Node and Express - Use the .env File

Tell us what’s happening:
Describe your issue in detail here.
So i’m using replit and keep getting an error, idk what to do.

https://replit.com/@shadownightmare/boilerplate-express-1#myApp.js

Your code so far

let express = require('express');
let app = express();
let absolutePath = __dirname + "/views/index.html";

app.use(express.static(__dirname + "/public"));
/*
app.get("/", (req, res) => {
res.send("Hello Express")
})
*/

app.get("/", (req, res) => {
  res.sendFile(absolutePath)
});

app.get("json", (req, res) => {
  res.json({"message":process.env['MESSAGE_STYLE'] == "uppercase" ? "HELLO JSON" : "hello json"})
})


console.log("Hello World")

 module.exports = app;

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.134 Safari/537.36 OPR/89.0.4447.104

Challenge: Basic Node and Express - Use the .env File

Link to the challenge:

What is the error you are getting?

What happens when you try to go to the json route?

https://boilerplate-express-1.shadownightmare.repl.co/json

Do you see anything displayed to the page?

I’m getting a “syntax error: unexpected token N in json at position 0”, and “error [ERR_HTTP_ERROR_SENT]”.

I see “Hello, HTML”, inputs and submit button.