Basic Node and Express: Use the .env File

The app does what its supposed to do (print “Hello json” as uppercase):

But I’m not passing the test.


Your browser information:

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

Challenge: Use the .env File

Link to the challenge:

Make sure you submit the URL from the preview window that opens when you run the code.

Edit: you need to move this const mySecret = process.env['MESSAGE_STYLE']; inside the GET route.

1 Like

Thanks a ton! It was the const being defined outside of the GET route.

1 Like

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