Env is Undefined

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

Your code so far

app.get(‘/json’, (req, res) => {
console.log(env.MESSAGE_STYLE);
if (env.MESSAGE_STYLE === “uppercase”) {
res.json(“Hello World”.toUpperCase());
}
else {
res.json(“Hello World”);
}
})

Your browser information:

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

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.