axios-axios/examples/post/server.js
techcodie f8694341de
docs: refresh CDN URLs and example JSON headers (#7236)
Co-authored-by: Jay <jasonsaayman@gmail.com>
2025-12-30 13:30:43 +02:00

17 lines
319 B
JavaScript

export default function (req, res) {
let data = '';
req.on('data', function (chunk) {
data += chunk;
});
req.on('end', function () {
console.log('POST data received');
res.writeHead(200, {
'Content-Type': 'application/json'
});
res.write(JSON.stringify(data));
res.end();
});
};