How configure .env (secret tab) on replit

I’m on the excercise use env file from the backEnd MOOC.
When i click on the tab, secret the program ask me :
a key :
a value :
and i get a button add new secret.

So i put a key with 123456789
a value with “MyVaue”

And now i got a message ( to use secret in Node.js )
const mySecret = process.env[‘123456789’] with a button insert

Ans i don’t know what i have to do to valid the exercise.

This is my code

const mySecret = process.env['123456789']
let express = require('express');
let app = express();
console.log("Hello World");

// Apelle d'un fichier static pour importer le fichier CSS
app.use("/public", express.static(__dirname + "/public")); 

// Récupere le HTML 
app.get("/", function(req, res) {
  res.sendFile(__dirname + "/views/index.html");

// Créer l'objet message : Hello Json avec un verbe GET, a la racine/json 
app.get("/json", function (req,res) {
    message : "Hello json"

if (process.env.VAR_NAME === "allCaps") {
  response = "Hello World".toUpperCase();
} else {
  response = "Hello World";
module.exports = app;
And when i running the test this is the answer  
// running tests
The response of the endpoint /json should change according to the environment variable MESSAGE_STYLE (Test timed out)

**Your browser information:**

User Agent is: <code>Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36</code>

**Challenge:**  Use the .env File

**Link to the challenge:**

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.