I'm use any possible way to solve the .env MESSAGE_STYLE Challengge but nothing work

app.get(“/json”, (req, res) => {
let jsonResponse = {‘message’: ‘Hello Json’};
if (process.env.MESSAGE_STYLE === ‘uppercase’) {
jsonResponse.message = jsonResponse.message.toUpperCase()

why this not working ?

boilerplate-express - Replit

I’m not so good with server side programming. But with a basic knowledge of js, I think you should use “return res.json(jsonResponse)” instead of “res.json(jsonResponse)”.

May I ask when you started this project (when you clicked on the replit starter link in the first challenge of the section)? I ask because we updated the starter boilerplate yesterday afternoon to fix an issue your boilerplate code has in it. Was curious if you started this project today or was it before yesterday afternoon?

The way to fix your issue is to go to the shell tab and enter:

npm update https://github.com/freeCodeCamp/fcc-express-bground-pkg.git

Make sure to Stop and Run again after the package is installed. Then try submitting your live url for the challenge again.

Thanks you Randell , i pass the task

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