// server.js
const express = require('express');
const app = express();
const bodyParser = require('body-parser');
app.use(bodyParser.urlencoded({ extended: true }));
app.post('/verwerk-formulier', (req, res) => {
// Ontvang de formuliergegevens van req.body
const naam = req.body.naam;
const email = req.body.email;
// Verwerk de gegevens naar wens
// ...
// Stuur een antwoord terug naar de client
res.send('Bedankt voor het indienen van het formulier!');
});
app.listen(8000, () => {
console.log('Server luistert op poort 8000');
});
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter