Basic Node and Express - Use the .env File

Tell us what’s happening:

I have done the task according to the given instructions. The MESSAGE_STYLE variable is set to uppercase and a check is made in the router handler of /json path GET API. Checked with the output also, got HELLO JSON as the uppercase message. But the test cases aren’t passing , can look into the project as well as the solution link to provide a resolve to this issue.

Your project link(s)

Your browser information:

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

Challenge Information:

Basic Node and Express - Use the .env File

Hi there and welcome to our community!

The response object should either be {"message": "Hello json"} or {"message": "HELLO JSON"} , depending on the MESSAGE_STYLE value.

const json = { message: "hello json" };

This is not the required ‘lowercase’ response. If you correct it, as above, your code should hopefully pass!

I have done it. But it still isn’t passing the test cases.

What link are you submitting in the solution box?

I have hosted the code on vercel. The link is available in the git repo. I’m not able to paste the link over here.

Sorry, perhaps I’m being dense but I can’t see a live vercel link anywhere in your git repo… where would I find this?


It’s on the right-hand side, below About.

Sorry, I did find it and I’m trying to see what the issue might be, as it’s not passing for me either.

Okay sir. Please look into it and Thank you for the help.

To be honest, I can’t see anything wrong with your code. It passes for me when I use replit. I don’t use vercel but perhaps there’s an issue with the way the env variable is set up there or something?

I used replit and the test cases passed. Thank you for your help, sir.

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