Server side variables
Express route callbacks take at least two parameters req
and res
.
They are HttpRequest (req
) and HttpResponse (res
):
HTML forms parameters
It reads the form data, prints it to the console and sends it to the template to be rendered back to the client. This example is only reading one field, but you can read all the fields that are being sent from the form to the route.
Note:* For this example to work add the body-parser middleware to your ExpressJS instance.
Here’s an example: Use ExpressJS to Get URL and POST Parameters: POST Parameters.