mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-20 14:39:06 +00:00
feat: download
- able to download file from express
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
// Create controller for GET request to '/ontime/download'
|
||||
// Returns -
|
||||
export const eventsDownload = async (req, res) => {
|
||||
res.download('db.json', 'ontime events.json', (err) => {
|
||||
if (err) {
|
||||
res.status(500).send({
|
||||
message: 'Could not download the file. ' + err,
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user