trying to change a value by .env value
using this code
app.get('/json', (req, res) => {
let m = "Hello json"
if (process.env.MESSAGE_STYLE === 'uppercase')
m = m.toUpperCase();
res.json({
"message": m
})
})
trying to change the message due to process.env.MESSAGE_STYLE value
but it is not working
why do i need VAR_NAME ?
the task says :
Create a .env file in the root of your project directory, and store the variable MESSAGE_STYLE=uppercase in it.
so i did it process.env.MESSAGE_STYLE
and i tested it
i just noticed that when i run server and go to heroku link /json it didnt do anything (no caps)
but when i go to localhost:3000/json it changed to uppercase !!
checked to log and nothing appeared to be wrong