Starting from Node.js 15.0.0 the chunk parameter of the response.write() can be a Uint8Array. This closes #870 issue on GitHub.
6 lines
168 B
JavaScript
6 lines
168 B
JavaScript
|
|
require('http').createServer(function (req, res) {
|
|
res.writeHead(200, {'Content-Type': 'text/plain'})
|
|
.end(Buffer.from('buffer', 'utf8'));
|
|
}).listen(7080);
|