<?php
header('Content-Type: application/json');
header('Access-Control-Allow-Origin: *');
require_once __DIR__ . '/../../database.php';

$db = new Database();
$conn = $db->getConnection();

if (!$conn) {
    echo json_encode(['success' => false, 'message' => 'فشل الاتصال بقاعدة البيانات']);
    exit;
}

echo json_encode([
    'success' => true,
    'message' => '✅ API الفاحص تعمل',
    'database' => 'digitals_autotester_db'
]);
?>