So when I follow the instruction, I would pass the challenge but I don’t see the message on the browser, but when I change the path(?), I can see the message
My passing code:
app.get('/json', (req, res) => {
res.json({"message": 'Hello json'})
which renders this result on the browser:
But if I change the path to /
like so:
app.get('/', (req, res) => {
res.json({"message": 'Hello json'})
})
I get this:
and this will not pass the challenge
The instruction clearly says, “you should see the message on the screen”. I’m confused.
Challenge: Basic Node and Express - Serve JSON on a Specific Route
Link to the challenge: