I cant pass the challenge
doing this challenge using a local pc
solution: http://localhost:3000
Your browser information:
myApp.js code
let express = require('express');
let app = express();
console.log("Hello World");
const note = {
"message":"Hello json"
};
app.get('/', (rq, rs) => {
console.log( "Hello World" );
rs.sendFile( __dirname + '/views/index.html' );
});
app.use("/public", express.static(__dirname + '/public'));
app.get('/json', (rq, rs) => {
if(process.env.MESSAGE_STYLE == 'uppercase'){
note.message = note.message.toUpperCase();
};
rs.json(note);
});
.env
MESSAGE_STYLE=uppercase
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36
Challenge: Basic Node and Express - Use the .env File
Link to the challenge: