I am have an awful lot of trouble with the Use the .env File question.
I have put together a solution in replit and used the SECRETS tab to set the variable.
My code works in replit but if I submit it to FFC, it does not work. I have read many forum comments but I can’t figure this out. Is the FFC grading not set up to handle the SECRETS tab? What is going on?
I have posted my code below. Also, here is the link:
var express = require('express');
var app = express();
const mySecret = process.env['MESSAGE_STYLE'];
app.get("/json", (req, res) => {
var message = {"message": "Hello json"};
if (mySecret=="uppercase"){
message = {"message": "HELLO JSON"};
}
res.json(message);
});
module.exports = app;