Add cache clear endpoint and timestamp to debug logs
This commit is contained in:
1 parent
07f46ce5c9
commit
b1b1c36839
1 file changed
+8
-1
+8
-1
@@ -420,7 +420,7 @@ app.get('/api/resources/:id/history', (req, res) => {
|
|||||||
// Get all resources' check history for dashboard (optimized with aggregation)
|
// Get all resources' check history for dashboard (optimized with aggregation)
|
||||||
app.get('/api/history/overview', (req, res) => {
|
app.get('/api/history/overview', (req, res) => {
|
||||||
const { days = 7, page = 1, page: pageParam, averaged = 'false' } = req.query;
|
const { days = 7, page = 1, page: pageParam, averaged = 'false' } = req.query;
|
||||||
console.log('History overview request:', { days, averaged, type: typeof averaged });
|
console.log('History overview request:', { days, averaged, type: typeof averaged, timestamp: new Date().toISOString() });
|
||||||
// Resource pagination (number of resources per page)
|
// Resource pagination (number of resources per page)
|
||||||
const pageLimit = parseInt(req.query.limit || 10);
|
const pageLimit = parseInt(req.query.limit || 10);
|
||||||
const currentPage = Math.max(1, parseInt(pageParam || page || 1));
|
const currentPage = Math.max(1, parseInt(pageParam || page || 1));
|
||||||
@@ -657,6 +657,13 @@ app.post('/api/test-webhook', async (req, res) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Clear cache endpoint for debugging
|
||||||
|
app.post('/api/cache/clear', (req, res) => {
|
||||||
|
cache.clear();
|
||||||
|
console.log('Cache cleared at', new Date().toISOString());
|
||||||
|
res.json({ message: 'Cache cleared successfully' });
|
||||||
|
});
|
||||||
|
|
||||||
// Serve React app with proper MIME types
|
// Serve React app with proper MIME types
|
||||||
const mimeTypes = {
|
const mimeTypes = {
|
||||||
'.js': 'application/javascript',
|
'.js': 'application/javascript',
|
||||||
|
|||||||
Reference in new issue
Block a user