From: xangelo Date: Fri, 26 Jan 2024 21:22:17 +0000 (-0500) Subject: force a default of 6 hours of articles on a fresh load X-Git-Url: https://git.xangelo.ca/?a=commitdiff_plain;h=7e428f976f22c313ba0adae17f77bae9fcd9d121;p=river.git force a default of 6 hours of articles on a fresh load --- diff --git a/src/server.ts b/src/server.ts index 0c93175..579f3ee 100644 --- a/src/server.ts +++ b/src/server.ts @@ -99,7 +99,8 @@ app.get('/river', async (req, res) => { const displayedItems = req.header('entry-count'); let firstLoad = true; - let createdAt = Math.floor(Date.now()/1000 - (60 * 60)); + const freshReadInHours = parseInt(process.env.FRESH_READ_IN_HOURS) || 6; + let createdAt = Math.floor(Date.now()/1000 - ((60 * 60) * freshReadInHours)); if(!displayedItems) { const temp = parseInt(header);