forked from ryanmwangi/CalMerger
check if .ics file exists
This commit is contained in:
parent
50ad583698
commit
96e25f7169
|
@ -112,6 +112,15 @@ app.get('/calendar/:name', async (req, res) => {
|
||||||
const icsFilePath = path.join(MERGED_CALENDARS_DIR, `${calendarName}.ics`);
|
const icsFilePath = path.join(MERGED_CALENDARS_DIR, `${calendarName}.ics`);
|
||||||
const jsonFilePath = path.join(MERGED_CALENDARS_DIR, `${calendarName}.json`);
|
const jsonFilePath = path.join(MERGED_CALENDARS_DIR, `${calendarName}.json`);
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Check if the .ics file exists
|
||||||
|
if (fs.existsSync(icsFilePath)) {
|
||||||
|
const stats = fs.statSync(icsFilePath);
|
||||||
|
const lastModified = new Date(stats.mtime);
|
||||||
|
const now = new Date();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Serve the merged calendar file
|
// Serve the merged calendar file
|
||||||
|
|
Loading…
Reference in New Issue