Firstly, add
res.status(201).json({ success: true }); --- remove this line
res.status(200).send(file being created as csv);
On Frontend in your service create a download method that requests the file on user click;
this.http.get('REST end point', { responseType: 'blob'}).subscribe(res => {
window.open(window.URL.createObjectURL(res));
});
check if this works!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…