Why doesn't the value is showing in uppercase?

Tell us what’s happening:
Describe your issue in detail here.

Here is the code

var express = require('express');
var app = express();
const mySecret = process.env['MESSAGE_STYLE']

app.get('/', function(req, res) {
  var absolutePath = __dirname + '/views/index.html';
  res.sendFile(absolutePath);
})
app.use( '/public',
  express.static( __dirname + "/public")

)
app.get('/json',function(req,res){
  res.json({
    "message":"Hello json"
  })
  if(mySecret == 'allCaps'){
    message = "Hello World".toUpperCase();
  }
})
































module.exports = app;

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36

Challenge: Use the .env File

Link to the challenge:

You haven’t told us anything or provided any code. Do you have a question?

1 Like

Yeah had include it but it got deleted accidentally :grinning_face_with_smiling_eyes:

are you sure this is the value that it should be?

wasn’t it Hello json?

You also have the issue that

this can only take the value it has when the app is started, but the value can change later

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