In my Node/Express app I have the following code, which suppose to read a PDF document from a file, and send it to the browser:
var file = fs.createReadStrea
Here's the easiest way:
app.get('/', (req, res) => res.download('./file.pdf'))
If this gives you trouble. Check the Express.js version or any middlewares that might be necessary.
Cheers