const express=require('express');
//body-parser
const bodyParser=require('body-parser');//express-static
var server=express();
server.listen(8080);
//use
server.use(bodyParser.urlencoded({}));
//处理用户请求
server.use('/',function(req,res){
console.log(req.body);//post数据
})
<body>
<form action="http://localhost:8080" method='post'>
<p>用户名:<input type="" name="uname"></p>
<p>密码:<input type="" name="upwd"></p>
<p><input type="submit" value='提交'></p>
</form>
</body>
网友评论