Skip to content
Advertisement

Tag: response

Node.js response API vs. Express.js response API

Both, Node.js and Express.js have response API. And it looks like there is even some overlapping between them, e.g.: Node.js: response.write(chunk[, encoding][, callback]) Express.js: res.attachment([filename]) res.download(path [, filename] [, options] [, fn]) res.sendFile(path [, options] [, fn]) res.send([body]) Which response API should be used for sending a response (e.g. JSON, files)? In other words, should I use response.write by Node.js

Advertisement