方便大家平时学习使用。
const http = require('http')
http.createServer(function (req, res) {
let body = ''
req.on('data', function (data) {
body += data
})
req.on('end', function () {
console.log(req.method, req.url)
console.log(body)
res.end('{"errcode":0}');
})
}).listen(3000);文章作者:沃航科技