const http = require("http"); const host = 'localhost'; const port = 8000; // Read request data from post requeest and log it to the console const requestListener = function (req, res) { let data = ''; req.on('data', chunk => { data += chunk; }); req.on('end', () => { process.stdout.write(data); res.writeHead(200); res.end(''); }); } // Create a server and pass in the requestListener function const server = http.createServer(requestListener); server.listen(port, host, () => { console.log("listening"); });