aggressive data collection :PP

This commit is contained in:
Heidi
2026-05-14 22:52:33 +01:00
parent 98f374a300
commit ef10da8b0b
6 changed files with 735 additions and 34 deletions
+5 -2
View File
@@ -5,11 +5,14 @@ import tailwindcss from '@tailwindcss/vite'
const MAX_TEAM_NAME_LENGTH = 80
function isAllowedApiUrl(req) {
if (req.method !== 'GET' && req.method !== 'HEAD') return false
const url = new URL(req.url, 'http://localhost')
const params = url.searchParams
if (url.pathname === '/api/viewers' && (req.method === 'GET' || req.method === 'HEAD')) return true
if (url.pathname === '/api/viewers/event' && req.method === 'POST') return true
if (req.method !== 'GET' && req.method !== 'HEAD') return false
if (url.pathname === '/api/tss/leaderboard/teams') {
const keys = [...params.keys()]
const limit = Number(params.get('limit') || 100)