【发布时间】:2016-04-03 21:43:00
【问题描述】:
我有一个函数,当 'dataCompiled' 事件触发时执行,它看起来像他的:
eventEmitter.on('dataCompiled', function () {
json = JSON.stringify({
conversations: convs
});
res.json(json).end();
return;
});
但是当我刷新页面时,我得到了错误
Error: Can't set headers after they are sent.
【问题讨论】:
标签: node.js http events callback header