add all files

This commit is contained in:
Rucus
2026-02-17 09:29:34 -06:00
parent b8c8d67c67
commit 782d203799
21925 changed files with 2433086 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
<?php
declare(strict_types=1);
use function Lasuca\SharedEndpoint\fetchLatestItems;
require_once __DIR__ . '/../src/Database.php';
$config = include __DIR__ . '/../config.php';
try {
$items = fetchLatestItems($config['mysql']);
} catch (Throwable $throwable) {
http_response_code(500);
header('Content-Type: application/json');
echo json_encode(
[
'status' => 'error',
'message' => $throwable->getMessage(),
]
);
exit;
}
$metadata = [
'generatedAt' => gmdate(DATE_ATOM),
'count' => count($items),
];
$payload = [
'status' => 'ok',
'metadata' => $metadata,
'items' => $items,
];
header('Content-Type: application/json');
header('Cache-Control: max-age=1');
echo json_encode($payload, JSON_PRETTY_PRINT);