DEV Community

Discussion on: FullStack setup (Node.js, React.js and MongoDB)

Collapse
 
pacheco profile image
Thiago Pacheco

Hi Csaba,

By the error, it could be something wrong with the definition of this app.delete method.
Does your backend log any error in the terminal when you test this endpoint?

If everything is correct in your code, the error could be the ID you are passing in the URL.
As this is just a simple tutorial and I wanted it to be short, it does not have validations but, in a final application, it should contain a lot of validations on the data we are trying to execute actions.

My suggestion to you is to check if the ID you are passing to the URL http://localhost:5000/api/product/<YOUR-PRODUCT-ID> is a valid ID.

Let me know if this helped you solve the problem and do not hesitate to ask if you have more questions.