Node JS : Error with res.download() after res.render()
问题 I'm beginning with Node JS, and I get an error : Error: Can't set headers after they are sent. You can see my code, the problem is with res.download() ; Or, how can I show the view without res.render() ? Can you tell me how to fix this issue? Thanks you! var express = require('express'); var app = express(); var pythonShell = require('python-shell'); app.set('view engine', 'ejs'); app.use(express.static('style')); app.post('/downloads', function(req, res) { res.render('downloads.ejs');