mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-05 05:52:46 +00:00
14 lines
366 B
JavaScript
14 lines
366 B
JavaScript
const sourceDL = function(res, brew) {
|
|
const fileName = brew.title.replaceAll(' ', '-').replaceAll(':', '').replaceAll('/', '');
|
|
|
|
res.status(200);
|
|
res.set({
|
|
'Cache-Control' : 'no-cache',
|
|
'Content-Type' : 'text/plain',
|
|
'Content-Disposition' : `attachment; filename="HomeBrewery-${fileName}.txt"`
|
|
});
|
|
|
|
return res;
|
|
};
|
|
|
|
module.exports = sourceDL; |