First of all, since you are using POST, I assume that you have existing body-parser middleware if you do not check the "Advanced PC software"
your code needs a few changes
in html
<form action="/home2" method="post"> <button name="butt" value='1'>butt1</button> <button name="butt" value='2'>butt2</button> </form>
and in expression
router.post('/home2', function(req, res, next) { console.log(req.body.butt); res.render('home2', { title: 'post' }); });
req.body.name must be req.body.butt
/ should be /home2
source share