39638-vm/healthz.php
Flatlogic Bot 1fafa67d4f kei
2026-04-14 13:52:40 +00:00

13 lines
526 B
PHP

<?php
declare(strict_types=1);
require_once __DIR__ . '/includes/app.php';
header('Content-Type: application/json; charset=utf-8');
try {
ensure_applications_table();
db()->query('SELECT 1');
echo json_encode(['status' => 'ok', 'time' => gmdate('c'), 'db' => 'ok'], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
} catch (Throwable $exception) {
http_response_code(500);
echo json_encode(['status' => 'error', 'time' => gmdate('c'), 'db' => 'error'], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
}