Server.js: add UI_TRAFFIC_STATS

This commit is contained in:
Philip H 2024-03-14 08:55:15 +01:00 committed by GitHub
parent e9480a5ed5
commit 8c771b054c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -63,7 +63,10 @@ module.exports = class Server {
return `"${LANG}"`;
}))
.get('/api/ui-traffic-stats', (Util.promisify(async () => {
return UI_TRAFFIC_STATS === 'true';
}))
// Authentication
.get('/api/session', defineEventHandler((event) => {
const requiresPassword = !!process.env.PASSWORD;