Tell us what’s happening:
I am not able to make this pass. I have tried multiple and resorted to copying what others have copied of off the internet.
var express = require('express');
require('dotenv').config();
var app = express();
process.env.MESSAGE_STYLE == "uppercase";
console.log(process.env.MESSAGE_STYLE);
//let app = express();
//console.log(process.env//.VARIABLE_ONE)
//app.use('/pics', express.static(__dirname + '/images'));
//console.log("Hello World");
/** app.get("/", (req,res)=>{
res.send("Hello Express");
});*/
// app.get("/",function(req,res){
//res.sendFile(__dirname + "/views/index.html");
//});
app.use(express.static(__dirname + "/public"));
/**6)use the .env File to configure app*/
app.get("/", function(req, res){
res.sendFile(__dirname+ '/views/index.html');
app.use(express.static(__dirname + "/public"));
})
//7.use the .env file
app.get("/json", (request, response)=>{
if(process.env.MESSAGE_STYLE ==uppercase){
response.json({"message" : "Hello json".toUpperCase()})
}else{
response.json({"message": "Hello json"})
}
});
module.exports = app;
###Your project link(s)
solution: https://3000-freecodecam-boilerplate-0mhpr76j63l.ws-us116.gitpod.io
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Challenge Information:
Basic Node and Express - Use the .env File