Sunday 29 October 2017

Should I use only POST and GET or use methodoveride in ExpressJS?

Hello guys.Imagine I have a todo list and I want to delete or edit one of the todo items.Every todo item has an delete button next to it. Should this delete button be wrapped with the form which will be doing DELETE operation with the help of the methodoverride package or is it alright to make it a link with a href that has a route inside of it and at the end the ID of the todo item? Like "href='todos/delete/123'" and then in the backend have the route for deletion like "todos/delete/:id" and directly delete it once a user click on that link?Also for editing, is it okay to use POST in the form to edit todo?Are there any benefits of using methodoverride and it's PUT and DELETE over only POST without methodoverride? :)Thanks :)

Submitted October 29, 2017 at 04:20PM by nikola1970

No comments:

Post a Comment