所以,只有在您确定一切都已完成时才执行“res.render”,对吗?因为它结束了请求并弹出了一个网页。
最佳答案
如果您不提供对 res.render(view[, options[, fn]])
的回调,它将自动给出一个带有 200 HTTP Status 和 Content-Type 的响应:text/html
res.render('view', {}, function() {
while (true); // should block
});
res.render(view[, options[, fn]])
Render view with the given options and optional callback fn. When a callback function is given a response will not be made automatically, however otherwise a response of 200 and text/html is given.
关于javascript - 在Node.Js Express中, "res.render"是否结束http请求?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5814897/