1<form method="POST" action="/submit-form">
2 <input type="text" name="username" />
3 <input type="submit" />
4</form>
1const express = require('express')
2const app = express()
3
4app.use(express.urlencoded({
5 extended: true
6}))
7
1app.post('/submit-form', (req, res) => {
2 const username = req.body.username
3 //...
4 res.end()
5})
6