Think of app.render() as a utility function for generating rendered view strings. Internally res.render() uses app.render() to render views.
treats app.render as a tool for generating views, and res.render also calls app.render internally.
The difference is this, app.render is only responsible for generating the view. You will find that it is not capable of responding to the view to the client (browser). Only res.render has the response object in hand and can respond to the view. to the client.
What the document says is actually pretty good
treats
app.render
as a tool for generating views, andres.render
also callsapp.render
internally.The difference is this,
The pseudo code ofapp.render
is only responsible for generating the view. You will find that it is not capable of responding to the view to the client (browser). Onlyres.render
has theresponse
object in hand and can respond to the view. to the client.res.render
can be seen as follows: