Tell us what’s happening:
Describe your issue in detail here.
Hello everybody, I’m stack on the solution of the REST challenge. I don’t really understand the syntax and I don’t know where do I have to write the code. Untill now, I’ve been writing all the code in the same file, myApp.js.
any help
Hopefully I’ll finish the course with a bit of help.
It would be helpful if you explained your confusion and asked questions.
I know your code is passing but you are using app.use(). It is a GET request so you want to use app.get(). You have in effect created a middleware function which isn’t what the challenge is asking for.
Replace use with get and remove the call to next()
Thank you very much for the help.
I know I should be asking questions, probably because i’m so beginner I still don’t know what to ask.
I write all the code on the file myApp.js, this file has got other pieces of code of the previous challenges.
Is that correct?
What do i espect to see?
On this one I know I have to see the message “Hello json” but I dont know where.
this is my solution
app.get("/json", function(req, res) {
res.json(
{ “Message”: “Hello json” });
});
I didn’t know how to run it so I just put /json at the end and it work but when I put it on the solution it doesn’t work. https://boilerplate-express.footroot72.repl.co/json