Прежняя git-история утрачена при переносе проекта на машину владельца (снапшот без .git). Хэши коммитов в docs/reports/* относятся к утраченной истории. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
22 lines
522 B
PHP
22 lines
522 B
PHP
<?php
|
||
|
||
declare(strict_types=1);
|
||
|
||
/**
|
||
* GET /api/health.php → 200 {"status":"ok"} (V.6).
|
||
* Проверяет доступность БД; при сбое — 503 без текста исключения.
|
||
*/
|
||
|
||
require __DIR__ . '/../lib/http.php';
|
||
require __DIR__ . '/../lib/db.php';
|
||
|
||
http_security_headers();
|
||
|
||
try {
|
||
method_must('GET');
|
||
db()->query('SELECT 1');
|
||
json_out(['status' => 'ok']);
|
||
} catch (Throwable $e) {
|
||
error_log('health: ' . $e->getMessage());
|
||
json_out(['status' => 'error'], 503);
|
||
}
|