-3
I would like to send a file to the browser to download
In express I do so:
app.get('/apk', (req, res) => {
res.contentType('application/vnd.android.package-archive');
res.download(path.join(__dirname, 'apk/apkName.apk'), apkName, (err) => {
console.log("ERRO? ", err);
res.send("ERRO! ", err);
});
});
What it would be like in restify?
I believe that there is no equivalent method, maybe you yourself need to create a function that reads the file and make the stream to the front.
– Cmte Cardeal
I tried to do a function, but I couldn’t... But now I did. I’ll answer
– Bruno Costa