26 lines
716 B
PHP
26 lines
716 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
require_once __DIR__ . '/app.php';
|
|
|
|
header('Content-Type: application/json; charset=utf-8');
|
|
|
|
try {
|
|
ensure_recliner_schema();
|
|
$count = (int) db()->query('SELECT COUNT(*) FROM recliner_presets')->fetchColumn();
|
|
|
|
echo json_encode([
|
|
'status' => 'ok',
|
|
'database' => 'connected',
|
|
'preset_count' => $count,
|
|
'timestamp_utc' => gmdate('c'),
|
|
], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
|
|
} catch (Throwable $e) {
|
|
http_response_code(500);
|
|
echo json_encode([
|
|
'status' => 'error',
|
|
'message' => 'Health check failed.',
|
|
'timestamp_utc' => gmdate('c'),
|
|
], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
|
|
}
|