router.get('/test', function(req, res, next) {
res.write("start\n");
setTimeout(()=>{
res.write('5 seconds later?');
res.end();
}, 5000);
});
Basically I just want to send my data in parts to the browser, but it seems to just hold all the data until it gets to res.end, then sends it all at once.
I tried all the answers in this thread: How can I output data before I end the response?
but they still all seem to just wait until the end and send it all at once.
Is there an update on how to accomplish this?