JSFiddle - React, Tailwind, and code Playground
JavaScript
http.createServer(function(req, res) {
if ((req.method === 'POST') && (req.url === '/result')) {
console.log("POST request to /result received");
req.on('data', function(chunk) {
console.log('Received data: ', chunk.toString());
});
req.on('end', function() {
res.statusCode = 200;
res.end("Message Received!");
});
}
}).listen(port, serverURL);