Basic Node and Express - Use the .env File

For what i want is to know where i can pass the process.env.VAR_NAME so as to access my response in the code below

here is my code

app.get(“/json”, function(req, res){
message: “hello json”,


Challenge Information:

Basic Node and Express - Use the .env File

You appear to have created this post without editing the template. Please edit your post to Tell us what’s happening in your own words.

you can use it whenever you need to check its value

this is an env file values I created

so when i want to transform the response from the function handler it can be like this;

app.get(“/json”, function(req, res) {
res.json({ message: “hello json”});


through this code am I correct?

yes, you can use process.env.MESSAGE_STYLE wherever you need.

well thank you, Am a beginner hopeful i will learn more things from you!
Same to the challenge No 5 “Serve Json on a specific Route” in this tutorial I failed to launch it in gitpod because the challenge says you need to access path /json in order to see the message {“Hello Json”}. so once I launch through gitpod no response from the browser and when i cope the solution link it says there is a problem, but when i launch local to my machine the response appear {“hello Json”}. the problem is how i can access the path “/json” in gitpod as my coding environment.

run the server, then you can append /json to the url of the browser preview