Getting completed forms server side

Hey, how would i be able to get the results from a basic html to the server, so i could save it in mongoose for example or send it with a webhook.


edit: im using express

From what i know you don’t need a parser middleware anymore as its included in express now.

Nice examples here (scroll down for the normal form format instead of json)

app.use(express.urlencoded())'/formpage', (req, res) => {

Not tested- should work

1 Like

Don’t know why the examples you linked are so confusing for such a simple task :joy:

and what should the action on the form be as i cant get it working?

<form action="/formpage" method="post">
<input type="text" name="name" placeholder="Name"></input>

Any errors? If so, send them here :slight_smile:

seems to work but how would i redirect the user back after they complete the form?

app.use(express.urlencoded())'/formpage', (req, res) => {
1 Like

Thank you (:

1 Like