How to find out which submit button was clicked in Node.js

When a user connects to my server, I would like to display 2 forms: "Accept" and "Reject" with the mail sending method sent to my server if the user clicks. How do I know which button was pressed when I process a request on my server?

0
source share
1 answer

To send two parameters, the REST URL must be

app.post('buttonclicked/:id/:submit',function(req,res){...} 

and at the end of the client the URL will look like

 http://<server domain>/buttonclicked/<id>/<accept/decline> 
+1
source

Source: https://habr.com/ru/post/1235934/


All Articles