Node.js: returning "this" from writeHead() to allow chaining.
In Node.js version 11.10.0 and later, the writeHead() function returns "this".
This commit is contained in:
@@ -3,6 +3,5 @@
|
||||
var fs = require('fs');
|
||||
|
||||
require('unit-http').createServer(function (req, res) {
|
||||
res.writeHead(404, {});
|
||||
res.end(fs.readFileSync('404.html'));
|
||||
res.writeHead(404, {}).end(fs.readFileSync('404.html'));
|
||||
}).listen(7080);
|
||||
|
||||
Reference in New Issue
Block a user