Basic Node and Express - Challenge 5 - Serve JSON on a Specific Route

I can’t pass the test. :weary:

I get the expected result, as the following image shows
and this is my code
I’m using VS code to all challenges.
I run both node server.js and npm start the answer is always this:

I tried all the solutions of this fórum, and NOTHING

Someone, help me, pls!

can you post the code here?
You need to read the env variable inside the route handler, if you haven’t done that already.

this is my code

app.get("/json", (req, res) => {
    res.json({"message": "Hello json"})

At my browser I can see the result correctly
just like the image I’ve sent

Remove the /json from the URL you are submitting. It should just be the root.


It worked. TKS man. I get stuck in this sentence:

Serve the object {"message": "Hello json"} as a response, in JSON format, to GET requests to the /json route. Then point your browser to your-app-url/json, you should see the message on the screen.

tks, btw