From c898cb0b24e9df883784b6679d0642bcdd6fa432 Mon Sep 17 00:00:00 2001 From: Ryan Mwangi Date: Thu, 24 Oct 2024 15:22:50 +0300 Subject: [PATCH] read the JSON file toget the source URL and other details --- server.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server.js b/server.js index cf94a02..baabff5 100644 --- a/server.js +++ b/server.js @@ -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; } } }