Tell us what’s happening:
Your project link(s)
solution: https://boilerplate-express-5.kalebelopes.repl.co/json
var express = require('express');
var app = express();
// app.get('/', (req, res) => {
// res.send('Hello Express')
// } )
// app.use('/public', express.static(__dirname + "/public"));
// app.get('/', (req, res) => {
// res.sendFile(__dirname + "/views/");
// })
app.get('/json', function(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; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36
.
Challenge: Use the .env File
Link to the challenge: