39957-vm/healthz.php
Flatlogic Bot 3cfcfefee3 v 0.1
2026-05-11 21:40:02 +00:00

25 lines
655 B
PHP

<?php
declare(strict_types=1);
header('Content-Type: application/json; charset=utf-8');
try {
require_once __DIR__ . '/db/pos_bootstrap.php';
pos_bootstrap();
$pdo = db();
$pdo->query('SELECT 1');
echo json_encode([
'status' => 'ok',
'time' => gmdate('c'),
'php' => PHP_VERSION,
'database' => 'connected',
], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
} catch (Throwable $exception) {
http_response_code(500);
echo json_encode([
'status' => 'error',
'time' => gmdate('c'),
'message' => 'health-check failed',
], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
}