Tell us what’s happening:
My test won’t pass, already searched many posts on this forum, but i can’t get my problem figured out, already added the .env file which i thought was the problem, but that’s about it, I thank everyone in advance for the support!
Your code so far
Repl.it link :
https://repl.it/@f3rn4nd0000/boilerplate-express#myApp.js
var express = require('express');
var app = express();
require('dotenv').config();
app.get("/", (req, res) => {
var path = __dirname + "/views/index.html"
res.sendFile(path)
})
var path2 = __dirname + "/public"
app.use(express.static(path2))
app.get('/json',(req,res) => {
if (process.env.MESSAGE_STYLE === "uppercase") {
res.json({"message": "HELLO JSON"})
} else {
res.json({"message": "Hello Json"});
}
})
module.exports = app;
Your browser information:
User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:83.0) Gecko/20100101 Firefox/83.0
.
Challenge: Use the .env File
Link to the challenge: