About the app.delete () command

0

I'm reading a book called "Mean_ Full stack JavaScript for web applications with MongoDB, Express, Angular and Node."

No "cap 5.7 - page 120" shows this:

// identificador iguais, muda apenas o verbo<
app.get('/contatos/:id', controller.obtemContato);
app.delete('/contatos/:id', controller.removeContato);

When I call the URL "https://localhost:3000/contatos/1" corresponding to the function app.delete('/contatos/:id', controller.removeContato); passing parameter the result is:

  

"Can not GET / contacts / 1"

I would like to know what the problem is, because I have not yet been able to identify it, because this function is covered later in other topics in the book, and it is difficult to follow the book without knowing what the error is. >

OBS: Switching app.delete('/contatos/:id', controller.removeContato); to app.get('/contatos/:id', controller.removeContato); it works.

    
asked by anonymous 15.11.2018 / 18:29

0 answers