WhatsApp-Logger-Self-Hosted-

A privacy-focused, self-hosted...
Log | Files | Refs | Activity | README | LICENSE

root / src / routes / logs.js

logs.js (551B)


      1 const express = require('express');
      2 const { verifyLogsAccess } = require('../auth');
      3 const { logBuffer } = require('../logger');
      4 const { logsPage } = require('../views/pages');
      5 
      6 const router = express.Router();
      7 
      8 // --- SYSTEM LOGS ROUTE ---
      9 router.get('/logs', verifyLogsAccess, (req, res) => {
     10     const wantsJson = req.query.format === 'json' || (req.headers.accept && req.headers.accept.includes('application/json'));
     11 
     12     if (wantsJson) {
     13         return res.json(logBuffer);
     14     }
     15 
     16     res.send(logsPage(logBuffer));
     17 });
     18 
     19 module.exports = router;
© notamitgamer • Site Built: 2026-09-05 01:53:16 UTC • git-mirror commit: c170d72 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror