Tell us what’s happening:
Hi,
I am trying to figure out the .env challenge, but the system cannot mark this as completed. I believe that the code i use is correct (have a look below) :
var express = require(‘express’);
var app = express();
const mySecret = process.env[‘MESSAGE_STYLE’]
app.get("/json", function(req, res){
if (mySecret == “uppercase”){
res.json({“message”: “HELLO JSON”});
}
else {
res.json({“message”: “Hello json”});
}
});
As you can see above i use the secrets tab of replit cloud platform.
Could you please, give me a little help regarding this.
Thank you in advance.
My project link
solution: https://boilerplate-express-5.mkorniotakis.repl.co
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0
Challenge: Use the .env File
Link to the challenge: