I’m working on basic Node and express challenge 6 i.e. create a .env file. I created the file .env and wrote MESSAGE_STYLE=uppercase (this is the only line of code we are required to write). I’ve attached my App.js code below. Your code so far
var express = require('express');
var app = express();
console.log('Hello World');
app.get("/",(req,res)=>res.sendFile(`${__dirname}/views/index.html`));
app.use(express.static(__dirname+"/public"));
app.get("/json",(req,res)=>{
let resultMessage="Hello json";
if (process.env.MESSAGE_STYLE==="uppercase"){
resultMessage=resultMessage.toUpperCase();
}
res.json({"message": resultMessage});
});
module.exports = app;
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.3 Safari/605.1.15.
The tests pass on my end when I submit your project. Please make sure you’re submitting the live URL, not the edit URL. In this case, you’ll want to submit https://real-rustic-pink.glitch.me/.