From d1084ea558e89c52dcef687d146128b89dffbd02 Mon Sep 17 00:00:00 2001 From: Ryan Mwangi Date: Thu, 24 Oct 2024 15:35:03 +0300 Subject: [PATCH] return the contents of the .ics file --- server.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server.js b/server.js index 8ed5e45..a3caefa 100644 --- a/server.js +++ b/server.js @@ -191,6 +191,10 @@ app.get('/calendar/:name', async (req, res) => { return res.status(404).json({ error: 'Calendar not found.' }); } + // Return the contents of the .ics file + res.setHeader('Content-Type', 'text/calendar'); + res.sendFile(icsFilePath); + } catch (error) { console.error(error); res.status(500).json({ error: 'Failed to retrieve calendar data.' });