response API should be used for sending a response (e.g. JSON, files)? In other words, should I use
response.write by Node.js or
res.sendFile by Express.js?
P.S. Initially for some reason I assumed that Express.js is now a part of Node.js, which is not a right assumption, of course.
Bearing in mind that Express.js is now a part of Node.js
what is the reason behind this overlapping?
Express.js uses the built-in HTTP module.
And which response API should be used?
The one for the response object you actually have, which will either be the built-in HTTP module or the Express.js module depending on if you are using Express.js or not.