базовая структура проекта создана

This commit is contained in:
2025-08-25 23:57:27 +03:00
parent caac61bbd5
commit c3a7fa53a0
7 changed files with 35 additions and 0 deletions

6
public/api.php Normal file
View File

@@ -0,0 +1,6 @@
<?php
require_once '../config.php';
$db = new PDO("sqlite:../db/dns.sqlite");
$topDomains = $db->query("SELECT domain, COUNT(*) as hits FROM logs GROUP BY domain ORDER BY hits DESC LIMIT 10")->fetchAll(PDO::FETCH_ASSOC);
echo json_encode($topDomains);