Friday, 1 June 2018

Adding form values to at path parameters on submit

So in my app.js file, I have a route structured like such:"/route1/:parameter1/parameter2".In an ejs file i have a form that on submit I would like to post to that route and add the values submitted in the form as the path parameters.I have done some hacky things with some functions to add the values, which have been partially successful(they add them in but I still have extra items in the url such as:/route1/:parameter1/parameter2?field1=value1&field2=value2).I can't imagine that I am the first one attempting this and I feel like I am overcomplicating the hell out of it due to my lack of knowledge. Is there a proper way to do this I am unaware of?Any help is greatly appreciated.

Submitted June 01, 2018 at 03:37PM by onlyslavesobey

No comments:

Post a Comment