serve updated merged calendar to user
This commit is contained in:
parent
e01c54e267
commit
3d31d039d8
|
@ -185,13 +185,19 @@ END:VEVENT
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Schedule a cron job to update the merged calendar every hour
|
// Schedule a cron job to update the merged calendar every hour
|
||||||
cron.schedule('0 * * * *', () => {
|
cron.schedule('0 * * * *', () => {
|
||||||
console.log('Updating merged calendar...');
|
console.log('Updating merged calendar...');
|
||||||
updateMergedCalendar();
|
updateMergedCalendar();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// serve updated merged calendar to user
|
||||||
|
app.get('/merged-calendar', (req, res) => {
|
||||||
|
const mergedCalendarUrlFile = 'merged_calendar_url.txt';
|
||||||
|
const mergedCalendarUrl = fs.readFileSync(mergedCalendarUrlFile, 'utf8');
|
||||||
|
res.redirect(mergedCalendarUrl);
|
||||||
|
});
|
||||||
|
|
||||||
// Start the server
|
// Start the server
|
||||||
const port = 3000;
|
const port = 3000;
|
||||||
app.listen(port, () => {
|
app.listen(port, () => {
|
||||||
|
|
Loading…
Reference in New Issue