serve the merged calendar file
This commit is contained in:
parent
4b27d84f92
commit
ecd4b3835c
1 changed files with 9 additions and 1 deletions
|
@ -129,6 +129,14 @@ END:VEVENT
|
|||
res.status(500).json({ error: 'Failed to merge calendars' });
|
||||
}
|
||||
});
|
||||
|
||||
// Serve the merged calendar file
|
||||
app.get('/calendar/:id', (req, res) => {
|
||||
const filename = `${req.params.id}.ics`;
|
||||
res.setHeader('Content-Type', 'text/calendar');
|
||||
res.sendFile(filename, { root: MERGED_CALENDARS_DIR });
|
||||
});
|
||||
|
||||
//function to save CalendarData to calendars.json
|
||||
function saveCalendarData(calendarId, calendars) {
|
||||
let calendarsData = { mergedCalendars: [] };
|
||||
|
|
Loading…
Add table
Reference in a new issue