1 2require('http').createServer(function (req, res) { 3 let body = ''; 4 req.on('data', chunk => { 5 body += chunk.toString(); 6 }); 7 req.on('end', () => { 8 res.writeHead(200, {'Content-Length': Buffer.byteLength(body)}) 9 .end(body); 10 }); 11}).listen(8080); 12