import { Router } from 'express'; import * as analyticsService from '../services/analyticsService'; const router = Router(); router.get('/summary', async (req, res) => { const raw = Number(req.query.window); const window: analyticsService.AnalyticsWindow = raw === 14 || raw === 30 || raw === 90 ? raw : 30; const summary = await analyticsService.summarize(window); res.json(summary); }); export default router;