read the JSON file toget the source URL and other details

This commit is contained in:
Ryan Mwangi 2024-10-24 15:22:50 +03:00
parent bab040df0f
commit c898cb0b24
1 changed files with 4 additions and 0 deletions

View File

@ -121,6 +121,10 @@ app.get('/calendar/:name', async (req, res) => {
// Check if the file is older than one hour
if (now - lastModified > 60 * 60 * 1000) {
console .log('Refreshing calendar data...');
// Read the JSON file to get the source URL and other details
const jsonData = JSON.parse(fs.readFileSync(jsonFilePath, 'utf8'));
const { linkGroupName, calendars } = jsonData;
}
}
}