Form my another question can't do multiple res.send in express.js
Can't find "res.write" in http://expressjs.com/4x/api.html
here is code example:
response.write("foo");
response.write("bar");
//...
response.end()
Form my another question can't do multiple res.send in express.js
Can't find "res.write" in http://expressjs.com/4x/api.html
here is code example:
response.write("foo");
response.write("bar");
//...
response.end()
This is because res.write
isn't part of express API. This is a server without express:
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.write('Hi,');
res.end('Hello World\n');
}).listen(1337, '127.O.O.1');
So you see the http
module already has already that req and res arguments, and express make do with adding properties to these objects.