25 lines
350 B
PHP
25 lines
350 B
PHP
<?php
|
|
// phpcs:ignoreFile
|
|
/**
|
|
* GET /api/health
|
|
*
|
|
* Health check endpoint for monitoring.
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
global $conn;
|
|
|
|
$dbStatus = 'ok';
|
|
|
|
if (!$conn || $conn->connect_errno) {
|
|
$dbStatus = 'error';
|
|
}
|
|
|
|
api_success([
|
|
'status' => 'ok',
|
|
'timestamp' => date('c'),
|
|
'database' => $dbStatus,
|
|
'version' => '1.0.0',
|
|
]);
|