1
0
Fork 0

generate URL for merged calendar using calendar ID

This commit is contained in:
Ryan Mwangi 2024-10-18 15:36:30 +03:00
parent 84f4d4b855
commit 2d3c90aa38
1 changed files with 3 additions and 3 deletions

View File

@ -89,11 +89,11 @@ END:VEVENT
`;
});
icalString += `END:VCALENDAR`;
fs.writeFileSync(filename, icalString);
fs.writeFileSync(`${MERGED_CALENDARS_DIR}/${filename}`, icalString);
// Generate a unique URL for the merged calendar
const mergedCalendarUrl = `${req.protocol}://${req.get('host')}/${filename}`;
// Generate URL for the merged calendar
const mergedCalendarUrl = `${req.protocol}://${req.get('host')}/calendar/${calendarId}`;
// Save the user input in a calendars.json file
const calendarsFile = 'calendars.json';